Observations of a Global Nomad
Spears, real spears, are a Eurasian innovation. Other continents independently developed variations, like javelins or short spears, but Eurasia had horses. When humans developed riding those horses, or camels, the natural evolution was in long spears as a counter. 
And one of the highest developments of spear tactics is the Greek phalanx. The image speaks for itself. The upper raised sarissas (long Greek spears, practically pikes) are pointing high to help deflect incoming arrows. The high organization, training, and discipline to hold formation in the face of charging cavalry, was the start of organized militaries. 
Horse-mounted cavalry has always had a big advantage over men on foot, so this is its response. Of course, the obvious defense is that imposing wall of pikes, but more important is that horses will rarely ever charge headlong into fatal peril. This causes the horse to rear back, buck or turn, at the very least losing the momentum of the charge, if not throwing the rider. 
It’s also effective against everything, from up front. Warfare between the different Greek states tended to result in long lines of Phalanxes facing off and seeing who gave up first. It has a clear weakness from the flanks and the rear, so those same Greek armies would each keep their lines long, each trying to outflank the other. 
Alexander the Great took the phalanx and combined it with effective use of cavalry. He would use the line to screen his movements behind the line, allowing his cavalry to move and outflank. After his death, Greek tactics reverted to the over-use of the phalanx in most cases. 
Still, its formation continued in popularity into the middle ages, where pike formations were formed similarly. 
The last moment of glory for Sparta, for example, was in forming a phalanx to turn a charge of Visigoth raiders in the post-Roman period. 

Spears, real spears, are a Eurasian innovation. Other continents independently developed variations, like javelins or short spears, but Eurasia had horses. When humans developed riding those horses, or camels, the natural evolution was in long spears as a counter. 

And one of the highest developments of spear tactics is the Greek phalanx. The image speaks for itself. The upper raised sarissas (long Greek spears, practically pikes) are pointing high to help deflect incoming arrows. The high organization, training, and discipline to hold formation in the face of charging cavalry, was the start of organized militaries. 

Horse-mounted cavalry has always had a big advantage over men on foot, so this is its response. Of course, the obvious defense is that imposing wall of pikes, but more important is that horses will rarely ever charge headlong into fatal peril. This causes the horse to rear back, buck or turn, at the very least losing the momentum of the charge, if not throwing the rider. 

It’s also effective against everything, from up front. Warfare between the different Greek states tended to result in long lines of Phalanxes facing off and seeing who gave up first. It has a clear weakness from the flanks and the rear, so those same Greek armies would each keep their lines long, each trying to outflank the other. 

Alexander the Great took the phalanx and combined it with effective use of cavalry. He would use the line to screen his movements behind the line, allowing his cavalry to move and outflank. After his death, Greek tactics reverted to the over-use of the phalanx in most cases. 

Still, its formation continued in popularity into the middle ages, where pike formations were formed similarly. 

The last moment of glory for Sparta, for example, was in forming a phalanx to turn a charge of Visigoth raiders in the post-Roman period. 

There is only one decent Hollywood representation of the Greek phalanx. It’s pretty much the only redeeming part of the film “Alexander.” In all other ways, it was pretty lame. In “300” they don’t even try to show it. Unfortunately YouTube doesn’t let me take clips from “Alexander” anymore so I’m forced to take from… the History Channel… Sigh. 

The phalanx is the first solid military formation making use of, essentially, pikes. The Greeks and Macedonians used sarissas, long spears, as forward barriers, which worked against just about anything. Battles between Greek city states generally involved two lines of phalanxes poking at each other until one side gave way. They would sometimes just try to see how long their lines would stretch and who could outflank the other, because while the phalanx was strong in the front, it was weak in every other side. 

Alexander’s success came from a combined arms approach. Instead of just focusing on the Macedonian phalanx, he had flexible archers, and excellent light cavalry. He would use his phalanxes to lock down an enemy, then use their lines to hide the movement of his cavalry, which would charge around the flanks and envelop an enemy. This is exactly what happened in most of his successes. 

After his death, his successors all generally returned to the focus on the phalanx. And that’s part of the reason they lost to the Romans, who were extremely flexible. 

“300” badly depicts the ancient battle of Thermopylae, where the Spartans and Thespians deployed in phalanx against the much more numerous Persians. The Spartans held out as long as they did purely because of the protection of their flanks by the narrow pass. Not because they were superhuman gung ho badasses.