I believe Dante learned the power of heaven during his trip through Hell. The fact that Dante was exiled due to his political believes plays a huge role on Dante’s ability to reflect on the evil people commit in the name of politics. Its why Dante keeps running into people that he knew on earth now in Hell, most of them political figures. Its the journey through Hell and the interactions with these characters that shapes Dante and teaches him what it mans to be a pious man. His journey that started for love of Beatrice is what lead him to a love for God as well.