Why are the high density regions in outer space black holes? The escape velocity of an object is given by the following formula.

$$v_e=\sqrt{\frac{2GM}{r}}=\sqrt{\frac{2 \mu}{r}}= \sqrt{2gr}$$

As far as I am aware, the mass of the star which formed the black hole is the same as the black hole itself, the only difference is the black hole's density. 

Now, the escape velocity of the star which formed the black hole is not as high because light can escape the star. Considering the equation above, $G$ is constant, $M$ is constant, however, $r$ changes resulting in a much smaller region as compared to the star. Consequently, it's the radius which determines the high escape velocity of a black hole, not its density. Then why is it that I always hear that black holes behave the way they do because they are highly dense regions in spacetime? What am I getting wrong? Thanks.
Making a major edit to this answer, as it would seem that there is a rather significant misunderstanding in the formula.

Initially describing r as the radius may have been a mistake.  While we may normally describe r as the radius of Earth when describing Earth, this is because we are describing the escape velocity of Earth from the surface, which means that the difference between our location and the center of gravity of the Earth is roughly equal to the radius of Earth.

When determining escape velocity from an arbitrary distance, r should be the distance between the escaping body and the center of gravity of the body being escaped. For objects at a normal distance, changing the volume, and thus the density of the object, will not affect nearby objects, as the mass stays the same.

However, this changes when you get close, when you compress the object this allows you to get closer to the center of gravity of the object. As you know, gravity is a weak force which deteriorates quickly with distance.  As such, when you decrease the volume of the body, a body can then become closer to its center of gravity, increasing the potential maximum escape velocity.

The body becomes a black hole when the physical volume of the body becomes small enough that the Schwarzschild Radius extends beyond it. Because we take the same mass, and decrease the volume, the result is a much denser area of spacetime, but this isn't generally the result of only a tiny volume, but also a large amount of mass.