"If" is a poem of extremes. If one thing is for certain, it's that whenever the speaker wants to make a point he goes from one extreme to the other. In stanza 2 there's "Triumph and Disaster," breaking and rebuilding in the third stanza, and then friends and foes, kings and commoners in the fourth stanza. These extremes are in the poem because the speaker wants to stress the importance of the middle. If his listener wants to be a man, and to have complete possession of the earth, well, he's gotta learn to stay in the middle.
Lines 11-12: Triumph and Disaster—these personifications represent pretty much opposing ends of the emotional spectrum. You're either a winner or a loser. All the same, the advice here is not to let either experience influence your mindset.
Lines 25-26: To be a man, or to be a leader, the listener must be able to hang out with kings and commoners and neither lose the common touch, nor his virtue. The kings and crowds here symbolize the two extremes of the social spectrum.
Line 27: This alliterative line follows a similar pattern as lines 25-26. The speaker's listener (his son) must not allow his foes or his "loving friends" (both F words) to hurt him.