A legend invented in the early 20th century by a guy called Arthur Monaghan and first appearing in print in 1911, Evans-Wentz's The Fairy Faith in Celtic Countries. He told Evans-Wentz a couple of legends/folk tales and relayed his personal speculation that snakes might have been a metaphor for druids.
Before that, everyone knew that the miracle of driving out all the "snakes and toads and other venomous reptiles" was literal. Jocelin of Furness swiped it from a continental saint's hagiography (St. Hilaire, probably, though there are multiple candidates) to beef up St. Paddy's resume in a new 12th century hagiography.
Patrick's two surviving 7th century hagiographies, written around 200 years after Patrick, make no mention of it. Although they (and Jocelin's) both have plenty of explicit claims of him engaging in magical duels with and kicking the asses of druids, so of course you'd have to be completely unfamiliar with them to think that there would be any cause to be coy and use a metaphor. Patrick's own writings of course make no such claims about snakes or kicking druid ass, as he had no such power or authority. He got thrown in chains once or twice. And pagans continued to have legal rights, druids being recognized under the law (though gradually more and more devolved in status and power) at least through the 9th century (ref. the Uraicecht Becc).