How do gears provide a mechanical advantage?
There is a law of "conservation of energy", not "conservation of force" and all "mechanical advantage" laws are based on that. If you have a cog of radius R m and turn it through on complete turn, [itex]2\pi[/itex] radians, by applying force F Newtons, then its surface has moved through a distance of [itex]2\pi R[/itex] m and so you have done [itex]2\pi RF[/itex] Joules work on it.
If a chain or other ratcheting mechanism causes another cog, of radius r, to turn through the same distance, by "conservation of energy" you have done [itex]2\pi r f= 2\pi RF[/itex] Joules of work on it also and so must have applied [itex]f= (2\pi RF)/(2\pi r)= (R/r)F[/itex] Newtons force. "R/r" is the "mechanical advantage".