system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do scientists know that the moon was formed from two planets colliding?

and how do they know how long ago it happened?
gpt
The reasoning goes like this:

The Moon missions brought back Moon rocks, which when studied, revealed that the Moon is primarily compromised of a kind of rock also found on Earth. Hence, scientists believe that the Moon's material came from Earth at some point.

They also know that when Earth was formed, the material comprising it was mostly homogeneous. It wasn't until millions of years later that the different types of rocks and materials began to stratify, or organize themselves by density (dense things sank to the core, while lighter things were displaced). Since the Moon's material is not only identical to the rocks on Earth, they are also mixed. This tells scientists that the event which created the Moon happened *before* the layers had a chance to properly layer themselves, as we see now.

So essentially we know that there is a timeline of de-homogenation that began shortly after the Earth was done, and careful analysis of the Moon rocks can show us where about on that timeline the material came from.