Each day the tides at any given place on Earth occur about an hour later then on the previous day. Since the Moon passes overhead about an hour later each day, it was long ago thought that the Moon had an effect on the tides.
One should consider a simple water molecule in the ocean. It is attracted gravitationally by the Earth, but it also "feels" an attraction from the Moon (the attraction to the moon is much smaller though because the Moon is much further away and much less massive than the Earth). Tides occur because the Earth has limits and these forces are not uniform: some parts of the Earth are closer to the Moon than other parts, and since the gravitational force decreases by the inverse square distance, those parts experience a larger gravitational pull from the Moon than parts that are further away.
In the situation illustrated in the shown figure, one can say that differential forces act on the body (the Earth in this example).
The effect of differential forces on a body is to distort the body. The body of the Earth is rather hard to manipulate, making distortion effects small (but finite). However, the water in the Earth's oceans is much more easily deformed and this leads to noticeable tidal effects.
A Simple Tidal Model
One can illustrate the basic idea of tides with a simple model of a planet completely covered by an ocean of uniform depth as illustrated in the figure below (friction between the ocean and the planet shall also be ignored in this situation). The gravitational attraction of the Moon produces two tidal bulges on opposite sides of the Earth.
The differential gravitational forces cause two bulges. One can think of the bulge on the left side...