Sparta never really kicked butt, they just propagandized themselves as having done so in the past, even though their performance is pretty average compared to other city states (and very dependent on their tributaries and slaves, at that).
Then Sparta started believing their propaganda and setting up a huge warrior caste, which sucked up resources for decades without ever really accomplishing anything. Then Philip rocked up and annihilated the whole place, their much-vaunted warrior caste had no chance against the Macedonians.
And fittingly enough, a good description of what Sparta was actually like and the myth of their warrior prowess is the same blog series as the original post: https://acoup.blog/2019/08/16/collections-this-isnt-sparta-p...