How does Dante gain an understanding of the importance of humility in his journey?

The goal of humility in Dante’s Inferno is important as the goal of honor and fame in non-Christian works. How does Dante gain an understanding of the importance of humility in his journey? What experiences help him to reach this important Christian virtue?