Most common cause: weak battery.
That bendix gear rides on a threaded shaft. When starter rapidly spins up, suddenly, inertia causes the bendix to rise up to mesh with the flywheel. When the engine starts, it spins faster than the starter motor, which screws the bendix gear back down, disengaging it.
If the battery is weak, the starter motor starts up too gradually, so the bendix gear is just spinning around with the shaft instead of shooting up to the flywheel.
Recharge or replace the battery and try again.
Second most common cause: sticky bendix gear threads. Add a couple drops light oil (I use 3in1 oil).
*DON’T* use a spray lubricant or WD40 — the bendix is mounted on a rubber friction clutch, to absorb the shock of suddenly engaging the flywheel. WD40 will make that clutch start slipping, and it’ll never work again — seriously it’ll require replacement.
*DON’T* use grease, it’ll just attract dirt.