Notice how freecoasters are tapered, becoming thinner away from the gear.
There is a metal cone inside that is mounted on the axle and can screw up and down the axle (that is, from the gear towards the other side). When screwed as far as it can go away from the gear, it bites into the hub shell, turning the wheel. When moving backwards, the cone screws toward the gear, disengaging the wheel and allowing it to move freely.
They're pretty neat.
"When you want to succeed as bad you want to breathe, then you’ll be successful"