Magnets attract certain metals like iron and nickel due to the property of magnetism. The first magnet was discovered when a shepherd noticed his iron nails being pulled toward a stone in Magnesia, and different types of magnets were later discovered. Magnets have poles where their strength is located, and they attract unlike poles but repel like poles. The Earth itself acts as a large magnet with geographic north and south poles opposite to its magnetic north and south.