Srimad Bhagavatam Canto 10, Chapter 14, Text 50

SB 10.14.50

sri-suka uvaca
sarvesam api bhutanam
nrpa svatmaiva vallabhah
itare ’patya-vittadyas
tad-vallabhatayaiva hi
 
Translation: 
 
Sri Sukadeva Gosvami said: O King, for every created being the dearmost thing is certainly his own self. The dearness of everything else children, wealth and so on is due only to the dearness of the self.
 
Purport: 
 
Sometimes modern thinkers become puzzled when they study the psychology of moral behavior. Although every living entity is inclined toward self-preservation, as stated here, sometimes a person voluntarily sacrifices his own apparent interest through philanthropic or patriotic activities, such as giving his money for the benefit of others or giving his life for the national interest. Such so-called selfless behavior appears to contradict the principle of material self-centeredness and self-preservation.
 
As explained in this verse, however, a living entity serves his society, nation, family and so on only because these objects of affection represent the expanded concept of false ego. A patriot sees himself as a great servitor of a great nation, and thus he sacrifices his life to gratify his sense of egotism. Similarly, it is common knowledge that a man feels great pleasure by thinking that he is sacrificing everything to please his dear wife and children. A man derives great egotistic pleasure by seeing himself as a selfless well-wisher of his so-called family and community. Thus, to gratify his proud sense of false ego, a man is prepared even to lay down his life. This apparently contradictory behavior is yet another demonstration of the bewilderment of material life, which has neither rhyme nor reason, being a manifestation of gross ignorance of the nonmaterial soul.
Srimad Bhagavatam Canto 10, Chapter 14, Text 49
Srimad Bhagavatam Canto 10, Chapter 14, Text 51