When your toothbrush is in its holder, components hidden inside the two objects form a complete transformer—a device that transfers electric power from one circuit to another via electric and magnetic fields alone. As long as the holder is plugged in, power flows through this transformer from holder to toothbrush, even though there are no electric contacts between the two objects. The absence of exposed wires isn't just a convenience, it's also a nice safety feature in an appliance that spends half its time dripping wet.
To understand the transformer, let's look at what's inside the holder and the toothbrush. Each of these devices contains a coil of wire. When an alternating current from the power company passes through the holder's coil, that coil becomes magnetic—it is surrounded by a magnetic field. Since the power company supplies alternating current, the current in the holder coil reverses directions many times a second and the coil's magnetic field reverses as well.
As British physicist Michael Faraday and American physicist Joseph Henry both discovered in 1831, a magnetic field that changes with time in this manner is accompanied by an electric field—a structure in space that pushes on electric charges. The electric field produced by the holder propels charges through the coil of wire inside the toothbrush and gives those charges the energy they need to operate the toothbrush. Because the holder coil's electric field reverses with each reversal of the power line, the current it pushes through the toothbrush's coil is also alternating. The toothbrush converts this alternating current to direct current with the help of semiconductor devices, making it suitable for charging the toothbrush's batteries.
Answered by Louis A. Bloomfield of the University of Virginia