A transformer is a device that changes voltage from one level to another. It has a primary coil and secondary coil. Alternating current flowing through the primary coil induces an electromagnetic field that cuts through the secondary coil, inducing voltage in it. The ratio of turns in the coils determines whether voltage is stepped up or down. Power is lost in transformers through resistance in the windings, eddy currents induced in the core, hysteresis losses from magnetizing/demagnetizing the core, and magnetic flux leakage not cutting the secondary coil. Losses are minimized through techniques like using thick copper wires, laminating the core, using soft-iron cores, and optimizing the magnetic flux path.