If gravity is the force that attracts bodies with mass together, how does this force of attraction work? Why should two bodies be attracted to each other?
Gravity is a familiar force: it is what keeps us on the surface of the Earth, and what keep planets in orbit about the Sun. Despite being such an everyday force, it has taken scientists a long time to unravel how it works, and there still remain some unanswered questions.
Our best theory of gravitation is Einstein's theory of general relativity (GR for short). In GR space is bent by the presence of mass (or energy, as Einstein's earlier theory of special relativity showed they are equivalent, yielding the infamous E = mc2 which allows you to convert between the two). The bending of space is commonly explained using the analogy of a rubber sheet. The sheet is flat when there is no mass, but if you were to place something heavy, say a bowling ball, in the middle, the sheet would stretch. Now imagine rolling a table tennis ball across the sheet. If the sheet were flat the table tennis ball would move in a straight line, but with the bowling ball there the table tennis ball moves on a curved path. If you couldn't see the rubber sheet it would appear as there was some force that is pulling the table tennis ball towards the bowling ball. This is the force of gravity in our analogy.
The real universe works in a similar way. An objects want to travel in a straight line, but when mass bends space, this line gets bent too, so the object follows a deflected trajectory. We say that this deflection is due to gravity. The physicist John Archibald Wheeler summarised this as "Space acts on matter, telling it how to move. In turn, matter reacts back on space, telling it how to curve".
Two bodies are attracted to each other as they curve space in a way that makes them want to move together. Imagine putting two bowling balls on our rubber sheet: they will fall towards each other. That is how the force of attraction works.