I know only stars do nuclear fusion to keeps its shape from gravity. Then what about the Earth? Earth doesn't do nuclear fusion. How does the Earth keep its shape even though the gravity keeps pushing Earth inward?
-
Do you mean why isn't the Earth compressed by its own weight? – John Rennie Jun 03 '19 at 04:46
-
Related. Why are planets not crushed by gravity? – Farcher Jun 03 '19 at 05:29
2 Answers
If there was only gravity, earth would indeed compress into a black hole. But don't forget about electromagnetism! It is the same reason you can not stick your hand through a table. The electron clouds from the atoms in your hand are repelled by the electrons from the atoms in the table. For Earth this means, while gravity pulls inward, there is a force equilibrium due to the outward push from the electrons. You need a higher mass to overcome this. Once you reach a critical mass, a process called deleptonization happens. The electrons are "ejected" and you're left with a neutron star. Now, there's the strong force between atomic nuclei which balances the gravitational pull. Once there is enough mass so that even the strong force is too weak, your body will collapse into a black hole.

- 1,224
Stars are (mostly) in hydrostatic equilibrium: at each depth in the star the pressure gradient balances the gravity, preventing it from compressing the star. This happens because a combination of the equation of state (relating temperature, pressure and volume; see also polytropes) and that the fusion processes heat up as the star gets compressed. The polytrope for stars is typically of the form $\rho=K P^{n/(n+1)}$, where $\rho$ is the density and $P$ the pressure, with $n\approx 3$ for main sequence stars.
Planets are in hydrostatic equilibrium because their equation of state typically behaves like $\rho = c + K P^n$ with $n\approx 0.5$. The reason is that they are solid or liquid rather than gaseous (gas giants are obviously slightly different). Inter-molecular forces increase a lot when one tries to compress such matter, and hence the density does not increase that much: the matter is stiff. For heavy planets degeneracy pressure starts to matter: when squeezing matter together electrons resist it fiercely since they would be forced into the same quantum states.

- 32,067