The Earth is composed of a rocky mantle with a metallic iron-rich core at its center. The segregation of the metallic core from the mantle was a formative event in the planet’s history. The mantle’s composition indicates that chemical interactions between Fe-rich metal and molten silicate rocks played an important role in the early Earth. This is because the Earth accreted through numerous energetic impacts, which caused widescale melting of the early mantle. Investigating the chemistry at the conditions that existed in the molten mantle or ‘magma ocean’ is therefore key for interpreting modern mantle geochemical signatures. I will present results from experiments carried out in laser-heated diamond anvil cells, on the chemical partitioning behaviors for highly siderophile (iron-loving) and volatile (easily vaporized) elements at extreme conditions that approximate Earth’s core formation. I will discuss how these measurements can be applied to constraining the Earth’s core and mantle compositions and to understanding other formative processes such as volatile accretion and loss. Ultimately, these early processes helped to shape not just the planet’s internal structure but also the surface and atmosphere.