Why did the Arian crisis thrive in the early Church to the extent that most bishops fell into heresy? Because bad shepherds wanted a peaceful co-existence with the secular leaders of their day. They were like the McCarricks their day, making peace with the Obamas and the Clintons. Even those who did not endorse heresy because they were personally opposed chose not to punish heretics. They were cowards.
The Protestant heresy thrived because of centuries of bad shepherds who ruled the Church. St Boniface said it so well: "no wickedness is bar to the priesthood or episcopate." You just had to know how to buy your way in by belonging to the right old boys network. And there have been plenty of bad popes guilty of nepotism, sexual deviance and much more. The papal palace was more like a brothel than a holy place.
There were also bad shepherds before the French Revolution and the Reign of Terror. I was reading a life of St Louis de Montfort recently who was punished not by the wolves outside the Church but within.
The author gives us many other illustrations of bad shepherds throughout the history of the Church. So how has the Church survived? As Catholics, we believe it is because the Church is the Mystical Body of Christ. Also, the faithful thrived while bishops and popes did the "devil's work" because they had the example of saints. The Church will survive by means of a well formed laity prepared to resist their leaders when those leaders fall away from the teachings of the Church.