Black holes are formed when the supermassive stars collapse under their own gravitational force. But why they should be supermassive. The gravitational force is also present in smaller bodies like earth and moon etc. Why they dont get compressed by their own gravity to form a very small black hole?
We all are familiar that squeezing or squashing an object by putting it between our palms and pressing is quite difficult (unless its elastic). And so is the case for smaller bodies. Think about the Earth. It will have to be compressed to about $9\ mm$ for it to become a black hole! You would require an enormous force to squash earth to so small a volume.
Why? Because the Earth is ultimately made of charged particles like electrons and protons and some uncharged neutrons. When you are squashing it, the forces between the charged particles (the electromagnetic force) soars higher and higher, causing it to counter gravity easily. And this is the primary the reason why smaller things don't collapse under their own gravitation.
But, massive objects have a different viewpoint. (I will assume you know that fermions like electrons, protons, and neutrons do not like to occupy the same quantum state, something called the Pauli exclusion principle). They have so large a mass, that they push the electrons inside the protons and cause them to form neutrons. This tremendously increases the density, causing further collapse. Now, these neutrons do not like to be together, and so they push themselves apart, which we call neutron degeneracy pressure. This counter force sometimes balances the gravitational collapse, and hence we have neutron stars.
But even more massive objects just cannot resist. Objects having a mass greater than the Chandrashekhar limit (approximately 3 solar masses), have so large a gravitational force, they push the neutrons and everything inside into each other and ultimately cause the body to fully collapse into a singularity with an event horizon. This region of spacetime is now a black hole.
So, we can finally say that the Pauli Exclusion principle and the electromagnetic forces are the main culprits why we don't live on a black hole!