Do you know why we see a spark when we unplug an appliance like a hair dryer? It's because of a special effect called electromagnetic induction. When the hair dryer is on, it creates a magnetic field. When we cut off the power, the magnetic field drops quickly, and this creates a voltage in the coil. This voltage can be so high that it makes the air between the plug and the socket spark.
But, this same effect can be useful. It helps us make smooth electricity for our phones and laptops. We use a special device called a charger to do this. The charger takes high voltage electricity and turns it into low voltage DC electricity. To do this, it uses a special technique called switching. It switches the current on and off many times per second.
But, we need to make the electricity smooth. We use a special device called an inductor to do this. It's like a shock absorber for electricity. It stores energy in a magnetic field when the current rises, and then releases it when the current falls. This helps make the electricity smooth.