Imagine if the Earth were the same mass, but 3,000 km in radius instead of the 6,000 km that it is now. The matter on the far side of the Earth from you is now half the distance that it used to be, which means that the attractive force of gravity from that matter is four times as great due to the inverse square law. If we re-calculate the gravitational force on the Earth we would find that instead of accelerating at 9.8 m/s2 we are now accelerated at about 40 m/s2. If we keep compacting the Earth into a smaller and smaller volume, the force of gravity continues to increase as the average distance between the matter decreases. Eventually we would reach the point where the Earth is so compact that an event horizon forms.
Note, however, that at distance much greater than the radius of the Earth the gravity barely changes. For example, the Moon orbits the Earth at a distance of about 380,000 km. Since that distance is much greater than the radius of the Earth, the gravitational force remains almost exactly the same before and after we compress the planet. This makes sense when you consider that even though parts of the Earth moved towards the Moon during compression, other parts moved away from it.