What causes the layered structure of the earth?
Differing densities in the materials present inside the planet.
The interior of the earth contains a number of substances, all of which have a unique density, which is how many atoms are present inside a given unit of space. Density determines wheather things sink or float in water. If a substance's density is lower than that of waters, it will float, if it is higher, it will sink. Same goes for substances in the earth. If a substance has a lower density, it will rise towards the surface. If it has a higher density, it will go to the earth's core.