How Earth and the ocean formed

“How did Earth form in the first place?”
Around 4.5–4.6 billion years ago, material around the young Sun gathered and collided to form Earth. The young planet was very hot.
“Was the sea there from the beginning?”
As Earth cooled, water vapor condensed and water collected in low places. Ancient minerals suggest liquid water existed about 4.4 billion years ago; whether there was an ocean like today’s is uncertain.
“Is Earth a planet with huge height differences?”
Everest to the deepest seafloor is roughly 20 km. Shrink Earth to a ball 12.7 cm across, slightly wider than a CD, and that difference becomes about 0.2 mm.
“Wait, seriously? That’s almost smooth!”
Not perfectly smooth: about two sheets of paper, if each is 0.1 mm thick. The water’s origins are still debated.
Sources: NASA · NOAA · Nature · 2001 · NOAA · Everest · NOAA · Challenger Deep