Magnetism is a force of nature that attracts and repels. Unlike gravity, which only attracts and which affects all objects, only some types of materials can be magnetized so that they exert magnetic force, and only some materials are affected by that force—mostly metals like iron and nickel. When an object becomes magnetized and exerts magnetic force, it is called a magnet.
A magnet has a magnetic pole at each end, one called the north pole and one called the south pole. Like poles repel, and opposite poles attract. That is, a north pole attracts another magnet’s south pole but repels a north pole, and south attracts north but repels south. The Earth is actually a giant magnet, which is why it has north and a south magnetic poles, and why the south pole of a small magnet (such as the tip of the needle on a magnetic compass) will always point north.
The magnetic force around a magnet forms a magnetic field. The field is made up of lines of force that run from the north pole to the south pole. When opposite poles are brought together, their lines of force join, but when like poles are brought together the lines of force push each other away.
Scientists long wondered if the attractive and repulsive forces of electricity and magnetism were related. In 1820 Danish physicist Hans Christian Øersted discovered that a wire with an electric current flowing through it produced a magnetic field. In fact, wrapping a wire around an iron core and running a current through it produces a strong magnetic effect; this is called an Electromagnets. British scientist Michael Faraday then discovered that a wire moving through a magnetic field developed a current running through it. This is called induction. These discoveries led to the invention of electric generators and electric motors. An electric generator turns motion (which could be caused by a variety of forces, including steam engine and wind power) into electricity. An electric motor turns electricity back into motion. These two machines are the basis of modern electric power.
Scientists wondered why electricity and magnetism were related in this way. In 1865 English physicist James Clerk Maxwell figured out that there is really just one field—an electromagnetic field—and that electricity and magnetism are not just related to each other, but are two different aspects of the same natural phenomenon. In fact, Maxwell realized that light is actually waves of electromagnetic radiation moving through space. So, not only are the effects of magnets and batteries electromagnetic phenomena, but so are the picture coming from a TV, a laser beam, and even the warmth from the sun responsible for life on Earth.
Furthermore, when scientists realized that light was electromagnetic waves, they were able to correctly guess that there should be light energy that people are unable to see with their eyes. This led to the discovery of radio waves—which enable radio, TV, and even cellular phones to work—and x-rays—which enable doctors to look inside you to see if anything is wrong. Much of our modern technology, it turns out, relies on electromagnetism to work.