Before we begin, let me say a word about the traditional Catholic conviction that a conclave unfolds under the guidance of the Holy Spirit. In 2005, this idea was summed up by Cardinal Ennio Antonelli of Florence, who said God already knew who the new pope was, so it was simply up to the cardinals to figure out what God had already decided.
Some pious souls take that to mean that it's inappropriate, even borderline heretical, to suggest that politics are involved. Yet Catholic theology also holds that "grace builds on nature," meaning that the spiritual dimension of a papal election doesn't make it any less political.
Anyway, one shouldn't exaggerate the role of divine inspiration. As one cardinal put it to me after the election of Benedict XVI, "I was never whapped on the head by the Holy Spirit. I had to make the best choice I could based on the information available."
Perhaps the classic expression of this idea belongs to none other than the outgoing pope, Benedict XVI, who as Cardinal Joseph Ratzinger was asked on Bavarian television in 1997 if the Holy Spirit is responsible for who gets elected. This was his response:
I would not say so, in the sense that the Holy Spirit picks out the Pope. ... I would say that the Spirit does not exactly take control of the affair, but rather like a good educator, as it were, leaves us much space, much freedom, without entirely abandoning us. Thus the Spirit's role should be understood in a much more elastic sense, not that he dictates the candidate for whom one must vote. Probably the only assurance he offers is that the thing cannot be totally ruined.
Then the clincher:
There are too many contrary instances of popes the Holy Spirit obviously would not have picked
Read everything here.