The Peloponnesian War did indeed pave the way for Philip II. The war resulted in events directly and indirectly leading to Philip II’s conquest of Greece.
Indirectly: The power vacuum
The two rivals - Athens and Sparta - had beaten each other to exhaustion during the conflict. Moreover, their alliances - the Delian League and the Peloponnesian League - had been resolved. There were no superpowers for an aspiring contender to stay clear of any more. The former superpowers were now just that: Former.
Then there was Thebes, which briefly took over hegemony of Greece after decisively defeating the weakened Spartans at Leuctra and Mantinea. Thebes did not have the makings of Empire. Thebans were neither mariner Athenians nor badass Spartans. They just didn’t inspire anyone, not even their neighbors in the Boeotean League, to stay the course. Their brief hegemony had been the result of two charismatic leaders (Epaminondas and Pelopidas) perfectly timed with Sparta’s weakened state.
In other words, the coast was now clear for a new power like Macedon to rise up and take the lead.
Directly: The Macedonian Hostage
Before rising to the throne of Macedon, Philip had been held hostage in Thebes. As a young prince he was privileged and spent time with the likes of Epaminondas, Pelopidas and Pammenes. Their influence had probably been immense as he received military and diplomatic training from them. These were the very men who had innovated warfare with the Oblique Phalanx and the Sacred Band’s dense shock formation to beat Spartans at their own game.
Consequently, Philip knew every trick up their sleeve. More importantly, he had learned to innovate and change the paradigm. He was about to deliver Thebes the same blow Thebes had dealt the Spartans with a few innovations of his own. At the battle of Chaeronea 20 years later, the ex hostage-pupil-guest Philip would extinguish his former hosts’ hopes at hegemony once and for all.