Why do spaceships get hot when they return to earth?

The spacecraft are being heated by friction with the atmosphere, due to the high speed at which they are travelling.

There are molecules of air being held by gravity around the Earth. This gravity-held zone is called the atmosphere. Gravity weakens with distance from the mass with distance. This is why the higher in the atmosphere the less molecules of air exist, while lower down more.

In space there are no concentrations of molecules of air, so nothing hits the spaceship even though it is spinning around the earth very, very fast to keep orbital velocity.

When it enters the atmosphere, it starts hitting these molecules of air which aren't moving very much. Since the spaceship is moving very very fast, it hits each molecule of air very, very fast like a car hitting something on the road. The higher up in the atmosphere, the fewer molecules it hits; the closer to the Earth, the more molecules it hits. This is called friction.

Every molecule of air the spaceship hits uses up a little teeny tiny amount of energy from the velocity of the spaceship. Imagine a Volkswagon bug hitting a deer. Odds are, the VW Bug will stop. If a semi truck hit the deer, it might keep going, but the deer will have slowed it down a little bit. This is because the truck has much more mass, therefore much more inertia. The spaceship has a lot of mass, and it has a LOT of inertia from speed, but it hits a LOT of molecules of air.

The disruption of it's velocity energy expended with each molecule it hits turns into heat. The deeper into the atmosphere it gets with a great amount of speed, the greater the heat since it's hitting more molecules at a time the faster it goes. The reason it hits more faster is the same reason that the faster you go in a car in a rainstorm, the worse the visibility is. There are the same amount of raindrops per inch no matter how fast you go, but if you go faster, your windshield runs into more of them faster since every second at higher speeds the more inches of rain your windshield runs into.

Scientists took this idea and created a way to slow a spaceship down with it. They created a flat bottom with a special ablative heat shield on the bottom of a space craft reentry vehicle to purposely absorb the heat of as many molecules of air as possible, but without burning up. Since there are a lot of molecules taking velocity energy from the spacecraft reentry vehicle, a lot of heat is created which can cause a lot of damage to the spacecraft, endangering the cargo inside. An ablative heat shield is designed to slowly shed minute pieces of itself when those pieces get too hot if needed.

Since the atmosphere is so deep, the spaceship if designed properly, has enough area to slow down enough to deploy simple parachutes to stop the rest of the way.

The space shuttle, though (as an example) does not have enough of an aerodynamic stopping effect, so it was designed to reenter at an angle instead, using its bottom side to maximize the effect of the size of its wing and tail area. It was also designed to come in at a shallow angle from space to hit more atmosphere. It has wheels to roll to a stop, to allow the rolling motion to impart more friction to help stop it.

So in summary, spaceships get hot when they return to Earth because of atmospheric friction.

---

It is also an example of the law of conservation of energy. Gravity is constantly exerting a force on the spacecraft, but by orbiting at high speed it avoids falling back to Earth. When it does return, it has to shed all that extra potential energy and the energy of its forward motion. It does so in the form of heat energy imparted to the air.

(Air friction, or drag, during launch also heats rockets and spacecraft, but to a lesser degree.)