One the mass and two a proportional radius. This in turn states that density has a great part in the formation of gravity. One very simple equation used to show escape velocity for a spherical body of mass is shown below. Now our sun will never experience this because for this to occur the sun would need to triple its mass. And since the sun is constantly losing mass, due to the tremendous amounts of energy being released, this won't occur.
Density has much to do with the event.
If our sun were to lose its internal gas pressure and gravity were to compress its mass to a sphere with radius 8.8 km, thus greatly increasing the density, then it would become a black hole. Using the equation above, we can derive an equation that will determine the radius of a spherical object with mass required for that object to become a black hole. To understand this we must know how gravity works. Think of gravity as a flat flexible grid. If you were to roll a spherical object past it, the rolling object would curve due to the small imprint of the stationary object.