system
Given the following post, respond as if you're commenting on Reddit:
human
How do we know what's inside a planet?

For example: The earth's core consists mostly out of iron, while the moon's hardly has any iron in it. How do we know? How do we measure the inside of a planet?
gpt
Basically, think of it this way.

There are these things called seismic waves. You're probably more familiar with them when its grouped up with Earthquakes, but there's more to it for geologists.

If you're not up to snuff, there's different kinds of waves (like P-waves and S-waves). And waves have to travel through *something*. Now, imagine it like light or sound. Put a pencil in a glass filled half way with water. See how the pencil looks different when observed through the liquid? Have you ever submersed yourself in water and then listened to something? It sounds completely different while you're above water doesn't it?

Same thing with seismic waves. They have to travel through layers of the planet, each with different composition of materials as well as varying states of matter (being solid/liquid/etc.). We have a general idea that some states of matter/some materials will block or alter the waves in a specific fashion. We also know how heat and pressure alter substances and how heat and pressure build as you get lower.

If you add it all up, basically the bulk of it comes down to recording several seismic waves and looking at the data. Among the first things we do is see how deep it is. With that we can make a very good estimation of pressures and temperatures. We know pretty well how a certain element (like Iron) would behave in those circumstances (be it in a molten state, or in a state of high stress where it may fracture, and so on). So we then compare, would Iron (in a similar circumstance) affect a seismic wave similar to what we recorded? If the answer is yes, then we can be safe to say that there is Iron involved.

There is an honorable mention to magnetic fields. They can't exist unless there's a molten core creating convection, and that also iron is present. There's also another honorable mention to radioactivity. Geologists use that extensively to measure all sorts of different things rock related.

But also keep in mind, a lot of this is really speculative. We can establish a pretty good lower and upper bound of several factors (meaning it should have at least this much Iron, but it can't have more than this much) but there's consistent improvements in research even now to give a more solid answer.

Geology undergrad here. That's the very basics of it, hopefully someone with some better knowledge drops by soon.