The repulsive force that prevents the collapse of matter within the Earth or atoms is primarily due to a phenomenon called electron degeneracy pressure.
In atoms, the repulsive force arises from the interactions between electrons. Electrons are fermions, a type of fundamental particle that obeys the Pauli exclusion principle, which states that no two identical fermions can occupy the same quantum state simultaneously. As a result, electrons in atoms occupy different energy levels and form electron shells around the nucleus.
The repulsion between electrons in these shells creates what is known as electron degeneracy pressure. This pressure arises from the principle that no two electrons can occupy the same quantum state, and as electrons are packed into increasingly confined regions, they exert a repulsive force on one another.
In larger structures like the Earth, the repulsion between electrons is not the primary factor preventing collapse. Instead, it is the electron degeneracy pressure in combination with other forces. The main contributor to the Earth's stability against gravitational collapse is the balance between the inward gravitational force and the outward pressure arising from the electron degeneracy of the electrons in the atoms that make up Earth's matter.
It's worth noting that in stars, the fusion of hydrogen into helium is driven by different forces. In stars, the high temperatures and pressures in the stellar core enable nuclear fusion reactions to occur. The fusion process releases a tremendous amount of energy, which counteracts the gravitational collapse. This energy generation sustains the balance between the inward gravitational force and the outward pressure, preventing the star from collapsing under its own gravity.
In summary, the repulsive force preventing the collapse of matter within the Earth or atoms is primarily due to electron degeneracy pressure, which arises from the interactions between electrons and their inability to occupy the same quantum state.