In quantum field theory, vector bosons are subatomic particles known as force carriers which are the quanta of their respective fields. For instance, the photon is the quanta of the electromagnetic field, thereby mediating the electromagnetic force. In particle physics, fundamental forces are seen to arise from the emission and absorption of virtual particles (i.e., particles which exist for a limited interval of time).
Let's consider the electromagnetic interaction between two, negatively charged electrons. According to quantum field theory, one of these particles will emit virtual photon which will be, shortly after, absorbed by the other, thereby transferring momentum from the emitting electron to the electron that absorbed the electromagnetic quanta. In fact, these types of processes can be nicely visualized using Feynman diagrams (https://en.wikipedia.org/wiki/Feynman_diagram). Here's the diagram for the exchange of a photon between two electrons as discussed earlier.

However, when it comes to gravity, it has yet to be described by quantum field theory. Nevertheless, many believe the gravitational field can be quantized into a spin 2, massive gauge boson (i.e., the graviton). In this model, which, might I add, has yet to be confirmed or disproved, would work in the same fashion as that of the electromagnetic force. As to mediate the gravitational force, a graviton would be exchanged between two particles that make up the Standard Model, thereby ensuring a transfer of momentum between the interacting particles.