When the Earth was completing its formation approximately 4.5 billion years ago, it was enveloped in a global ocean of molten magma, extending hundreds to thousands of kilometers beneath its surface due to violent impacts. This early environment bore little resemblance to the habitable conditions we experience on Earth today.
Source:
phys.org