The mechanism boils down to an exchange of energy between the Earth and moon. The moon’s gravitational pull creates a slight bump in the solid surface of the Earth, near to, but not exactly underneath where the moon is. The disparity between the bump’s position and the moon’s pull creates a torque on both the Earth and moon with the end result that the Earth slows down gradually.
That rotational energy is transferred to the moon, which is moving away from the Earth ever so slowly, at a rate of about an inch and a half every year.