A pike is, quite simply, a long spear. The first major military use of pikes occurred under Phillip of Macedon, who used a variation of the ancient Greek phalanx formation using pikes or sarissa. This tactic was later used to great effect by Phillip's son Alexander the Great. The pike fell out of favor until the late Middle Ages, when it was found that pikes were effective, cheap anti-cavalry weapons when used in formation, which could easily be used by peasants with little training. As such, pikes were used extensively by the Scots, the Flemish, and the Swiss in the 1300s.
During the late Middle Ages and Renaissance period, pikes became staple of European armies. Pikemen were often deployed in formation with crossbowmen and early firearms such as the Hand Cannon and later the Matchlock Musket, in what was known as the "pike and shot" formation. These formations were used through Europe during the 1500s and 1600s, and a similar formation was adopted in Japan by Oda Nobunaga, combining yari, or Japanese pikes and tanegashima- Japanese matchlocks. Nobunaga used this formation to great effect at the Battle of Nagashino, wiping out the elite Takeda cavalry.
Pikes fell out of favor after the invention of the Bayonet rendered them unnecessary, as each musketeer could now double as a pikeman. The pike would occasionally be used in later conflicts, mostly peasant uprisings when firearms were in short supply.