According to the Galileo Project, William Gilbert discovered magnetism when he realized that the Earth functions as a giant magnet. Before his discovery, magnetic iron ore (also known as lodestone) was used in compasses, but its properties and functions were not understood.
Gilbert also discovered that beating wrought iron could induce magnetism and that heating the iron could cause the magnetism to dissipate. This ultimately lead to the creation of more magnets. Gilbert's 1600 book "De Magnete" revolutionized the way Europeans thought about magnetism and electricity, becoming the standard in its field of study. Before Gilbert, magnetism was believed to be caused by supernatural forces.