Since the Romans conquered the Greek states and the Greeks' military was based predominantly around phalanxes of pikemen, I want to understand how the Romans managed to subdue Greek armies.
I know that phalanxes were vulnerable in the flanks and the rear, but the Romans never really had much in the way of cavalry (did they?) and a Roman legionary is a heavy infantryman, trained to fight in formation. As such I wouldn't imagine that the legions were terribly manoeuvrable, so just how did the Romans defeat the Greek states, and render the phalanx obsolete in ancient warfare?
TL; DR - how does a man with a gladius beat a man with a pike?
It is important to distinguish between two (broad) types of phalanx: the hoplite phalanx and the Macedonian phalanx.
The hoplite phalanx is the traditional Greek phalanx. The soldiers had a spear of 2 or 3 metres (6 to 10 feet) in length in their right hand, and a large round shield on their left arm. In phalanx formation the shield would cover the left side of the soldier carrying the shield and the right side of the soldier next to him. For this reason, maintaining close formation is absolutely essential for a phalanx. If for any reason the formation is broken (uneven terrain, hills, streams), the entire phalanx is in grave danger. A phalanx is on big block of men all trying to stay partially behind the shield of their neighbour. For this reason phalanxes tended to edge to the right, and a battle between two phalanxes might involve them turning 90 degrees or even more over the course of the battle.
The Macedonian phalanx is a bit different from the hoplite phalanx. They used a sarissa, a spear twice as long as the normal hoplite spear. It was so long (several meters) that it had to be wielded with two hands. This precluded the use of a large shield, but they might have a small shield tied to their arm or shoulder. The disadvantage of not having a shield was offset by the advantage of having twice as many spearpoints in front of the formation. The first four or five ranks would be able to use their weapon before the enemy had closed the distance to the first rank. If the enemy made it there though, the first rank had no real other protection. So keeping a close formation with as many spearpoints close together as possible was still essential. By the time the Romans fought the Greek city states, most had adopted the Macedonian phalanx.
As gruesome and deadly as phalanx warfare was, it was not nearly as effective as the Roman manipular system was. Firstly, Roman legionaries had javelins, which they threw at short distance. A Macedonian phalanx would have nothing to counter this (remember no big shields!), other than closing in as fast a possible. Secondly, the legionary formation was a bit looser than the phalanx formation. The Roman legionaries used swords, which required a bit more room to wield than simple holding a spear above your shoulder. For this reason the distance between individuals in the Roman formation was larger than in a phalanx. This extra space would give a legionary more opportunity to dodge the stabs (whereas a phalangite wouldn't be able to move left or right at all because of their tight formation). Furthermore, the gladius sword was unlike anything the Greeks/Macedonians were familiar with. As Livy says:
those who had seen wounds done by spears, arrows and occasionally lances, in their regular fighting with Greeks and Illyrians, saw bodies beheaded by the Spanish sword [gladius], arms and shoulders hacked off or necks entirely cut through to separate the heads from bodies, entrails gaping, and hideous other wounds; in a panic they realised what weapons and what men they must fight against. (Livy 31.34.4, as quoted by Hoyos)
Of course you're wondering now how did they go from throwing javelins outside of spear range to stabbing and hacking with a sword at close distance? This brings me to the third point. The Roman legion was a lot more flexible than a phalanx. At this time, the Romans used the manipular legion; this meant that the legion was divided into sub-units called maniples, which would manoeuvre in formation, but with large gaps between maniples. The maniples would form not in one line, but in three lines, which the maniples in each line covering the gaps in between the maniples in the line in front of them. This brought so much flexibility: they could easily take advantage of gaps in the enemy's line, they could attempt flanking manoeuvres, they could reinforce their own lines where needed (unlike a phalanx). Furthermore, the Romans did have cavalry to threaten the enemy's flanks. Though it wasn't the core of their army and it wasn't an exceptional fighting force, it usually performed to a decent standard.
So here's your recipe for defeating a Macedonian phalanx: try to fight on uneven ground to disrupt their formation; try to disrupt their formation using your javelins; try to flank them; use your flexiblity to exploit any disruptions in their formation.
This is all ignoring perhaps the most important factor in ancient battles: intimidate your enemy so that they don't want to fight. It was not uncommon for enemies to flee simply at the sight of a Roman army advancing, or to decide that running is the better option after being on the receiving end of a javelin toss.
Sources:
edit: typos, formatting
This is a minor rant but is actually a question.
Every time this question gets asked anywhere on the Internet, someone brings up how flexible maniples are, or how much room they had between soldiers. But that doesn't really answer the question, does it?
I'm way more interested in what your front line dudes are looking at. As in, an angry group of men with big sticks. You've got your shield and a short sword. You've thrown your two pilum. How does it go from here? I mean, these armies have to line up, facing each other right? So there's going to be guys facing off at the pointy end of a phalanx, no matter what. And if a phalanx is famous for anything, it's for being a meat grinder if you go at the front. And you have to at least have something up front, otherwise the phalanx wouldn't be pointing in that direction to start with.
What are those guys doing while the inevitable flank happens? Do you bash the mass of really very sharp sticks away and try to close to sword range? Do you try and keep your distance, and them distracted? Is that going to last long enough for your flanking guys to break it up? Do you try and pull them into rough terrain and then close with swords, even though they've still got really long sharp sticks? Do you use Greek auxiliaries with equally long sticks to punch in old-school and then use the famously flexible maniple or not so famous Roman cavalry to swing around the edges?
Am I missing something really obvious?