Electricity and magnetism power the modern world. Most of our modern technological marvels use either electricity or magnetism in some way. Some devices use both. Magnetism and electricity are connected at a fundamental level. Electricity can be created by magnetism, and magnetic fields can be created by electricity.
Electric motors are devices that convert electrical energy into motion. They do this by use of magnets. Oersted's Principle shows that electrical currents create their own magnetic fields. Motors work by making electricity flow into loops of wire that are suspended inside a magnetic field created by magnets. The magnetic field that the loops of wire create push against the magnetic field of the magnets, causing them to rotate. This rotation turns the axle of the motor, and anything the axle is attached to.
Electric generators are similar to electric motors. They are also formed of loops of wire suspended in a magnetic field created by magnets. However, they work in exactly the opposite manner from motors. Generators use motion to create electricity by means of magnets. Faraday's Law shows that when a wire is exposed to a changing magnetic field, an electrical current arises. When the axle of the generator is turned, the loop of wire turns. This causes the loop to be continually exposed to a changing magnetic field, which causes electricity to flow in the loop. Generators use many different power sources to turn the axle and loops, such as propellers driven by wind, wheels turned by water, and even hand cranks.
Electromagnets are man-made devices that mimic the effects of natural magnets. Electromagnets are essentially just coils of wire attached to a battery or other source of electricity. By Oersted's Principle the current in the coil creates a magnetic field. The shape of the coil makes the magnetic field take the same shape as that of a bar magnet. Electromagnets can do anything that natural magnets can do. They can also do some things that natural magnets can't: their strengths can be altered by altering the current flowing in them. They can also be turned off.
Superconducting magnets are similar to electromagnets. However, they are made of special materials that have virtually zero electrical resistance. Because of this, once electricity starts flowing in a superconductor it keeps on flowing even when the power source is removed. Coils of superconducting wire can generate magnetic fields even without a battery or power source.