The first point to address in this context is the fact that gravitational force is related to mass. In fact the relation is very simple: gravitational attraction is directly proportional to the mass of the object. It is also easily understandable that the attraction will be stronger nearer the object and weaker further away.
A useful analogy would be the heat felt around a fire. The larger the fire the stronger the heat, and it will feel hotter near the fire than further away.
Normally if a spaceship feels pulled towards an attracting object like a planet or a star, it can be accelerated to move away from the pulling object. But if the object is very large there is a distance from the surface below which the maximum speed of the spaceship will not be enough to escape the attraction.
Let us think of the attraction of the Earth. A stone thrown upwards with our bare hands will always fall back down. We will never be able to give it enough speed so that it will escape into space. So, what is it that objects need to escape from the surface of the Earth? Let us consider objects we know that actually manage to escape from the Earth’s gravitational pull: rockets. To escape from the Earth the rocket needs to reach a certain speed. Anything reaching that certain speed will be able to travel into outer space (be it a rocket or a stone). This speed, called the escape velocity, is 11.2 kilometers per second or 25,950 miles per hour at the surface of the Earth, decreasing with distance from the Earth.
Now let us think back and see if we can find anything else that is able to escape the gravitational pull of the Earth. Yes, there is something else that can travel into space: light. We know it because when seen from space the Earth shines, reflecting the light from the sun. See for example the unique photograph taken by the space probe Voyager II when it was pointed back at the Earth to take a final farewell picture. It was the first photograph taken where both the Earth and the Moon appear together as seen from a distance. It can be viewed together with more recent ones at Photos of the Earth and Moon – From Other Worlds.
A further proof that light is able to leave the Earth is the phenomenon called “Earthshine:” the glow of the Earth as it reflects the light from the Sun. Earthshine can light up the dark side of the moon. The adequate conditions to see this happen occasionally and it is a beautiful view to enjoy. It also makes for beautiful photographs: you just need to Google “Earthshine” to obtain an extensive gallery of images.
Finally, there is further evidence that light is able to escape from the pull of the Earth from the Apollo moon missions. The astronauts left behind on the Moon a small mirror to which a laser beam (light) is pointed regularly to monitor the gradual change in the distance between the Moon and the Earth. This distance is established by measuring how long it takes the laser beam to travel to the Moon and back after it is reflected on that mirror. More details about this can be obtained at What Neil & Buzz Left on the Moon.
So, we know now that rockets and light have speeds high enough to overcome the gravity of the Earth and escape into space from its surface. As we said before, the gravitational force that a lump of matter exerts depends upon its mass. This means that more massive objects will have stronger gravitational pulls and higher speeds will be necessary to escape from the gravity of those objects. And as we consider higher and higher masses we reach an object massive enough so that its gravitational pull will not even allow light to escape from its surface.
But we also know that nothing can travel faster than light, so what happens then? Well, then nothing, not even light itself can escape the object from below this limit – the Event Horizon. We then have a black hole. And it is not called “black” because there is no light on it – it is just that light cannot leave the black hole for us to see it: it “falls” back down just like a stone thrown upwards on Earth.
As mentioned above, only very massive objects can be a black hole. For example, certain massive stars become black holes once the thermonuclear reactions in their core run out of fuel and the stars cease to shine, breaking the equilibrium between the outward push from their radiation and the inward pull from gravity, in favor of the latter. The star is then left entirely to gravity. The subsequent collapse gets rid of the lighter stuff when it rebounds into space in the form of a formidable supernova explosion and leaves the very heavy matter behind, collapsing even further into a dense sphere of remnant matter that becomes a black hole.
Once in place, such a black hole is certainly a place to be avoided by passing spaceships. This is why it is such an interesting place for science fiction!
In the film Star Trek, the villain creates a back hole inside the planet Vulcan using the so-called “red matter”. The black hole devours the whole planet in a matter of seconds. Red matter and making black holes are of course fictional, but there were concerns about mini black holes being formed as a by-product of the subatomic collisions that the Large Hadron Collider (LHC) run by the European Particle Laboratory CERN in Geneva (Switzerland) was meant to create. Although theoretically these mini black-holes were plausible, their formation is highly unlikely and in fact, have not happened since the LHC started operating.