Is it based on the distance between the Earth and Moon? Would that make the Moon move away faster or slower as time goes on?
The Moon is currently receding from the Earth at a much faster rate than it had been receding for the last half a billion years or so: about 3.8 cm/year currently versus about 2.2 over the last 620 million years. The average recession rate over the last two or three billion years has been estimated to be a mere 1.2 cm/year. On the face of it, this does not make much sense considering only the Earth-Moon distance as the sole driver. The Moon's recession rate should be decreasing rather than increasing given that tidal forces drop with the cube of distance.
The key drivers of the Moon's currently anomalously high recession rate are widely attributed to resonances between tidal forces and tidal responses, with the current size and shape of the North Atlantic causing strong resonances. Despite its small size (compared to the Pacific), 41% of the tidal energy dissipation occurs in the North Atlantic -- and this dissipation occurs primarily in a rather small portion of the North Atlantic.
I agree with the answers privided by David Hammen and Arjun, and would like to only add some details.
Aside from the ocean tides, there also are so-called bodily tides which are periodic deformations of the (not completely) solid part of the Earth. While the ocean tides have a pretty complex picture defined by the shape and depth of the seas, the picture of bodily tides is simpler, its main component shaped as a double bulge rotating in the prograde direction.
Were the Earth spinning slower than the mean motion of the Moon, the bulge would be following the Moon, with some angular lag. In reality, the Earth is spinning faster than the Moon's mean motion, so the bulge created by the Moon is not lagging but advancing.
[ I reiterate that the concept of bulge is applicable to bodily tides. As David Hammen rightly emphasised, the picture of ocean tides is too complex to be depicted as a bulge. ]
The bodily tides generated by the Moon in the Earth are contributing to the tidal evolution of the Earth-Moon system. Just like the ocean tides, they are working to increase the distance between these bodies, and to spin-down the Earth. Their effect, however, is an orderr of magnitude weaker than that of the ocean tides.
The bodily tides generated by the Earth in the Moon are working in an opposite direction, wishing to slow-down both the tidal ascent of the Moon and the ensuing tidal spin-down of the Earth. This happens because the spin of the Moon is synchronised, in average, with its mean motion about the Earth. Were this synchronisation not in average but exact (which would be possible under a zero eccentricity of the orbit), the tidal deformation of the Moon would be stationary and would bring nothing to the tidal evolution of the system. Owing to a nonzero eccentricity, however, the tidal bulge on the Moon is not pointing exactly towards the Earth but is librating (oscillating around the direction towards the Earth). Hence the said effect. The effect of bodily tides in the Moon is weaker than that of the bodily tides in the Earth -- and much weaker than that of the ocean tides.
There also exist atmospheric tides, but this is a feeble effect, in the case of the Earth. (Not in the case of Venus though, with its dense and massive atmosphere.)
The idea that the spin of the Moon had been synchronised by the tides in the Moon, and that the lunar tides in the Earth will eventually synchronise also the spin of the Earth was pioneered by Immanuel Kant who arrived at this conclusion via purely qualitative considerations. This result of Kant is not well known even to philosophers, because he published it in two successive issues of a local newspaper, and very few people are aware of this work by Kant.
The moon moves away because the moon causes Earth's rotation to slow down.
It is due to Tidal interactions in the Earth-Moon system.
Because the Moon has gravity just like the Earth which exerts gravitational force on the Earth causing tides hence the name tidal forces, A particular type of tidal force, known as tidal friction, which arise from the stain caused by the tugging of gravity, the tidal friction of the Moon reduces Earth's angular momentum along it's obliquity of the ecliptic (a.k.a rotation/spin) but according to Newton's 3rd law, an action has an equal and opposite reaction so in the case of angular momentum too there should be an action-reaction pair which is called tidal interactions in Astronomy and since the action force (which is the tidal force in the tidal interaction pair) slows down the spin, the reaction force increases the Moon's revolution speed (which is the tidal response in the tidal interaction pair) thus via Keplers 3rd law (it was made for planetary motion but I think it should also apply to natural satellites), the radius vector ideally should also increase thus it will appear to move away from Earth (from Earth's frame of reference). Also, whenever the Moon interacts with the bulge, it causes the moon to accelerate which in turn also increases the centrifugal force and that disturbs the natural equilibrium and since gravity is unable to stop it the distance would be increasing at a decreasing rate of about 3.78 cm per year.
The rate would increase, because as the distance increases gravity's intensity would reduce since gravity is an inverse square force field (the inverse square law applies on it) thus the gravity tugging it would decrease thus the centrifugal force will exceed the gravity faster (though the tidal friction will decrease too, considering inertia the inertial acceleration is keeping up so it is increasing) thus the rate would increase but it would never turn into acceleration (unless gravity of the Earth is even more stronger so that it stops it until it has moved out of Earth's Hill Sphere).
Note: The tidal interactions are basically an rotational analogue of the normal force and gravity except that the normal force is stronger than gravity