Most ceiling fans come with a remote control transmitter/receiver pair. The transmitter is hand-held or wall-mounted, and the receiver is installed in the ceiling box. Input to the receiver is a 2-wire circuit from the house wiring (neutral & hot, white & black) and output is white/black/blue, that is, neutral plus hot for the fan and hot for an optional light.
My question is, how does the receiver work, specifically the reverse function ? The light control is probably just a triac like an ordinary light dimmer, and the fan speed is likely controlled using switched capacitors (as described in How do ceiling fan controllers work?). The mystery to me is, how does reversing the fan direction work ? (Some fans include a reverse switch on the fan motor itself, but many do not, so the remote receiver must somehow accomplish this). I doubt it reverses the neutral and hot connections to the fan motor (I don't see how this would work, and it may violate code). Does it somehow send a code to some logic in the fan motor ?
Note (as pointed out below), this question really boils down to: how do you reverse a ceiling fan motor using only the two wires going to it ?