Was it the shields? Weaker-than-in-the-past Greek armies? Better leadership?
good answers in here- http://www.reddit.com/r/AskHistorians/comments/1jchdl/how_did_the_roman_army_defeat_phalanx_armies/
I gave an extensive answer to that question a couple of weeks ago:
How would a Roman legion defeat a Hellenic phalanx?