According to current scientific understanding, not anything can become a black hole solely by compressing it to a certain density. The formation of a black hole requires specific conditions, particularly related to mass and density.
Black holes are formed from the remnants of massive stars that have undergone gravitational collapse. When a star with a mass several times greater than that of our Sun runs out of nuclear fuel, it can no longer support itself against its own gravity. The core of the star collapses under its own weight, leading to the formation of a black hole.
The key factor in black hole formation is mass. For a star to become a black hole, it typically needs to have a mass at least three times greater than the Sun's mass. This critical mass is known as the Tolman-Oppenheimer-Volkoff (TOV) limit. If the collapsing core's mass is below this limit, it will result in the formation of a dense object known as a neutron star, rather than a black hole.
The density required for a black hole to form is extremely high. It is not simply a matter of compressing an object to a certain density, but rather reaching a critical density within a specific mass range. The exact density depends on the mass and size of the collapsing object.
In summary, while black holes are formed from collapsed objects, it is not accurate to say that anything compressed to a certain density can become a black hole. The formation of a black hole involves specific mass and density thresholds, typically associated with the remnants of massive stars.