A spear was made to keep a point at a distance from the person holding it. That reach mattered for hunting, where a wounded animal could be dangerous, and for fighting, where a longer point could strike an opponent before they got close. The design was also simple and cheap, which made it useful for almost anyone.
Reach and distance
A wooden shaft adds length to a point. Someone holding a spear could strike at an attacker while staying out of reach of a short weapon such as a knife or a sword. Spears were useful against both people and animals for this reason.
Hunting
Spears let hunters strike large animals without getting close enough to be gored, kicked, or clawed. The wooden spears found at Schöningen in Germany, roughly 300,000 years old or more, are generally read as hunting weapons. Their age is one reason archaeologists think the spear is one of the earliest tools people made.
Throwing
Some spears were built to be thrown. Light javelins were made for this purpose, and heavier throwing spears, such as the Roman pilum or the Frankish angon, were meant to be thrown at close enough range to hit a shield or a body, then left behind or used again if possible.
Simple to make
A spear needs little more than a straight shaft and a point. Wood was easy to find, and the point could be stone, bone, bronze, or iron, depending on the time and place. Ash was a favored shaft wood in later periods because it is strong and tough. A broken shaft could be replaced, which kept the weapon practical for people who could not afford expensive equipment.
Spears in medieval armies
Spearmen made up a large share of many medieval armies. Packed together in formation, they could hold off cavalry, since horses are reluctant to charge into a wall of points. Knights used lances, a longer kind of spear, for charges. For how armies were organized and how many soldiers each unit held, see medieval military unit sizes.