The short answer is: when the Moon rotates one cycle around its axis, it also completes one revolution around the Earth! Here's a diagram showing what's happening during one cycle:

(the distance is not to scale) Let's say the Moon starts out at the right of the diagram. During one revolution around the Earth, the "white" side of the Moon goes from left -> bottom -> right -> top and back to the left side of the Moon, completing one rotation around its axis.
The fact that the period of revolution is the same as the period of rotation for the Moon is not a coincidence. The gravitational field of the Earth is stronger on the part of the Moon nearer the Earth and weaker on the far side. That causes the Moon to distort its shape a little compared to what it would otherwise be. We can easily see the same sort of effect of the Moon on the Earth, since the liquid part of our planet distorts a lot from this "tidal force".
Back when the Moon was rotating enough to expose different sides to the Earth, the creaking of those tidal distortions provided a source of friction, gradually pulling energy out of the rotation until it was synched with the orbit. Similar effects are currently slowly changing the Earth's rotation and the Moon's orbit around it.
- Tsung +mbw
(published on 07/04/2011)