Transformers are devices that increase or decrease the voltage of alternating current by using two coils of wire wrapped around an iron core. They work by inducing a changing magnetic field in one coil to generate a current in the other coil. The ratio of turns of wire in the primary coil to the secondary coil determines whether the transformer is a step-up transformer, increasing voltage, or a step-down transformer, decreasing voltage. Transformers are used to efficiently match electrical loads that require different voltages like powering electronics or appliances from main power supplies.