A transformer converts one voltage to another. It only works with alternating current, in which the direction of the electrical flow periodically changes. Since energy cannot be created or destroyed, the power passed by a transformer remains the same at the output. Since the voltage changes, the current must change so that the amount of power is the same, less the losses of the transformer.
The transformer is a sort of electrically-powered generator, arranged so that it has no moving parts. A transformer has at least two coils or windings. As current flows through the powered winding, or primary, the winding produces a magnetic field that grows through the unpowered windings. As the magnetic field passes the unpowered winding(s), or secondaries, it causes current to flow in them. As the current changes direction, the direction of the magnetic field and electric flow reverse, causing the same effect in reverse. The change of magnetic field causes the parts of the transformer to vibrate, which is why transformers hum.
The winding with less turns of wire has higher current, at lower voltages. The winding with more turns of wire has less current, at higher voltages. The ratio of voltage is proportional to the number of turns of wire. For example, a 5-to-1 step-down transformer might take 1200 volt 60 cycle alternating current, and change it to the 240 volt alternating current actually distributed to houses. It might have 500 turns of wire on the primary, and 100 turns on the secondary. Many electronic appliances have several secondaries to produce several different voltages needed in the appliance.
The high-current low-voltage windings have fewer turns of thicker wire. The thicker wire helps carry more current. The high-voltage, low current windings have more turns of thinner wire. The thinner wire carries less curent, but at a higher voltage.
Some transformers have equal numbers of windings on both coils. These "isolation" transformers are used to prevent direct current flow between electric circuits, while transferring power.
Some transformers are designed so that one winding turns or slides, while the other remains stationary. These can pass power or radio signals from a stationary mounting to a turning mechanism, such as a machine tool head or radar antenna.
Some moving transformers are precisely constructed, and used to measure distances. Most often, they have several primaries, and electronic ciruits measure the shape of the wave in the different secondaries.
Transformers often have silicon steel cores to channel the magnetic field. This keeps the field more concentrated around the wires, so that the transformer is more efficient. The core also keeps the field from being wasted in nearby pieces of metal.
Cores are often made of many stamped pieces of thin steel. This prevents eddy currents from forming in the cores, and wasting power by heating the core. Some cores are made of nonconductive magnetic materials, various chemically-pure compounds of rust called "ferrite."
Power transformers are usually more than 98% efficient. The higher voltage transformers are bathed in nonconductive oil that's stable at high temperatures. These used to be polychlorinated biphenyls, the famous toxic waste, "PCB". Nowadays, nontoxic very stable fluorinated hydrocarbons should be used. The oil cools the transformer, and helps prevent shorts. It has to be stable at high temperatures so that a small short or arc will not cause a breakdown or fire.
"Transformers" is also the name of a line of toys produced by Hasbro, and the cartoon series and movie spinoffs from them. A Transformer is a robot that is able to reconfigure itself into the form of a more common and innocuous machine, such as a car or an airplane; the toys had the tagline "More than meets the eye" to reflect this ability for disguise. There were originally two main factions of Transformer, the Autobots and the Decepticons, and they were engaged in a war for the control of their home planet Cybertron. Lacking energy (in the form of "energon"), the Autobots sent a mission to Earth to scout for new sources and a force of Decepticons pursued them there.