This model shows the oscillating mechanism of a fan.
The long shaft is connected directly to the fan blades (not shown) and the large step in the shaft represents the motor. The shaft is driving a worm gear which has a smaller gear connected below it. This smaller gear is meshed with a bigger gear and a link is connected to the outer radius of the bigger gear. The other end of the link is restricted to only move in one direction, causing the link to oscillate. This link is then connected to the frame of the fan and will drive the oscillation of the entire fan. This movement can be seen in the video below.
When the pin isn't pressed down, the gears aren't in contact with each other and only the shaft is rotating. This state prevents the fan from oscillating but still allows the fan blades to turn.
When the pin is pressed down, the gears are moved into place and the fan begins to oscillate.