After Apollo 12 left the lunar orbit, this image of the moon was taken from the command module. NASA

The moon is thought to have been formed soon after Earth itself came into being somewhat over 4.5 billion years ago. At some point in its past, our planet’s only natural satellite had a magnetic field, which disappeared about three billion years ago.

We know the field existed because of magnetized rocks that were collected by the NASA’s Apollo missions to the moon. Lunar samples from 3.1 billion years ago show the distinct presence of a magnetic field one as strong as generated by Earth today. What we don’t know is how that field became inactive between then and now. There are various theories, but one put forth in a recent paper published in the journal Earth and Planetary Science Letters is simpler and more straightforward than others.

According to the paper, a dynamo in the lunar core — very little is definitively known about the composition of the core of the moon — powered the field. Written by scientists from the Astromaterials Research and Exploration Science Division at NASA’s Johnson Space Center in Houston, the paper also describes how that dynamo itself was created as a result of the core’s crystallization.

Read: A Heat Engine To Keep Astronauts Warm On The Moon

The researchers used the latest available geochemical data from the moon to create three different possible core compositions. Then they equilibrated each of those models with the temperature and pressure of the lunar interior. Based on the different amounts of iron, nickel, sulfur and carbon in the core, the paper offers the simplest explanation yet for the lunar dynamo.

In the distant past, the moon’s core was likely a majority of iron and/or nickel, with sulfur and carbon present only in small amounts, giving it a very high melting point. Therefore, the lunar core began crystallizing early in the moon’s history, and the heat released as a result was responsible for the magnetic field recorded in samples from that time.

“Our work ties together physical and chemical constraints and helps us understand how the moon acquired and maintained its magnetic field — a difficult problem to tackle for any inner solar system body,” Kevin Righter of NASA, who was also first author of the study, said in a statement Wednesday.

The paper also speculates that the lunar core, currently thought to have a solid interior and a liquid exterior, would today be partially solid and partially liquid.

Titled “Phase equilibria of a low S and C lunar core: Implications for an early lunar dynamo and physical state of the current core,” the paper was published in the journal Earth and Planetary Science Letters.