Here's why:
* Gravity is a force of attraction between any two objects with mass. It doesn't require a distance between the objects. Even though the force of gravity is extremely weak at short distances, it is still present.
* The strength of gravity depends on the mass of the objects and the distance between them. When objects are touching, the distance is minimal, but the force is still there.
* We experience this every day. The weight of objects, the reason why we stick to the Earth, and even the reason we can stand on solid ground is due to gravity acting on objects that are touching.
However, when objects are touching, other forces like the electromagnetic force become much stronger than gravity and dominate the interaction. This is why we don't feel the gravitational attraction between two people standing next to each other. The electromagnetic forces holding their bodies together are much stronger.
In summary, gravity is always present, even when objects are touching. However, other forces often overshadow its effects at such close distances.