In 1968, just a year before the historic Apollo 11 Moon landing, NASA scientists discovered something that could have sent astronauts Neil Armstrong, Buzz Aldrin and Michael Collins plunging to their deaths: an unexpected gravitational force—one so strong it caused the unmanned Lunar Orbiter spacecraft to violently shake up and down as it orbited Earth’s neighbor.

The cause, NASA determined, was the presence of “mascons,” or mass concentrations of especially dense rock just below the surface of the Moon, with much stronger pulls than the rock that surrounds them. Scientists adjusted accordingly to land the Apollo. But for decades, a pressing question lingered: how could these mascons—not found anywhere on Earth—even exist in the first place?

Today, as published in Science, we finally have an answer. In short: blame the asteroids—and the make-up of the Moon itself.

Mascons are always found within impact basins, the huge, roughly circular depressions created when asteroids smashed into the Moon billions of years ago. Since the depressions are lower than the surrounding surface, and therefore hold less rock, you’d naturally expect less gravity in these locations. But there’s actually more.

That’s because the Moon is made like lemon-meringue pie. No, really. As Science paper co-author and planetary scientist Jay Melosh explains, the crustal rock on the surface has a relatively low density, like meringue. And the mantle underneath is like lemon filling—it’s denser than what’s on top, and warm enough to flow under pressure (even though it’s technically solid). When asteroids strike, they blast through the Moon meringue and drill deep into its lemon filling.

At that point, according to the basic principles of physics, the filling is supposed to rush into the hole, rising to the surface while it’s hot, then sinking back down as it cools—effectively restoring the normal density-gravity balance. But that doesn’t happen on the Moon. Why?

Because—and this is the big breakthrough—on the Moon, the top cools much more quickly than we thought. So when the uber-dense lemon filling (a.k.a. the mantle rock) wants to sink back into the hole, it can’t. Instead, says Melosh, it glues itself to the meringue (a.k.a. the crustal rock). And—presto!—a mascon is born.

Of course, Melosh, who’s been researching mascon origins since the 1970s, didn’t work alone. One of his biggest clues came in the ’90s from MIT’s Maria Zuber (a co-author of the Science paper), who used gravity measurements from the Lunar Prospector spacecraft to show that the mascons were sitting higher up in the lunar crust than they should be. “I didn’t really believe it at first,” Melosh recalls. “All of us were very uncertain.”

The crucial data came from last year’s Gravity Recovery and Interior Laboratory lunar mission, which allowed Melosh’s team to run two sets of computer code—one that simulated an asteroid impact, the other that modeled the far more drawn-out process of mantle flow and cooling—with enough authority to confirm their mascon theories.

But that information came at a cost. In order to get the best measurements of lunar gravity, controllers sent GRAIL down to perilously low altitudes. To compensate for the mascon pull, says Melosh, “they had to fire their thrusters three times a week. They didn’t want to crash before the mission was over.”

Once the data was gathered, however, the thrusters went dry. And the mascons, which had been forced at last to expose the secrets of their origin, exacted their revenge.