The Buddha shares the benefits of developing a mind of loving-kindness based on his direct knowledge.
Metta sutta - Loving-kindness
This was said by the Blessed One, said by the Arahant, so I have heard:
"Bhikkhus, do not be afraid of merits. Merits, bhikkhus are a synonym for happiness, for what is desirable, lovely, pleasing, and agreeable. I personally know that for a long time, bhikkhus, I have experienced the desirable, lovely, pleasing, and agreeable results of merits accumulated over a long time. For seven years, I developed a mind of loving-kindness. As a result, for seven cycles of [universal] contraction and expansion, I did not return to this world. During the cycles of universal contraction, bhikkhus, I was reborn in the radiant Brahmā world. During the cycles of universal expansion, bhikkhus, I was reborn in an empty Brahmā palace.
Bhikkhus, at that time, I was Brahmā, the great Brahmā, the conqueror, unconquered, all seeing, and sovereign ruler. Bhikkhus, thirty-six times I was Sakka, lord of the gods. Many hundreds of times, I was a king, a wheel-turning monarch, a just and righteous ruler of the four quarters, victorious, who had achieved stability over the land, and possessing the seven treasures. What need is there to speak of regional rulership.
Bhikkhus, this thought occurred to me: 'Of what kind of deed of mine is this the fruit? Of what deed's result is it that I now possess such great power and influence?' Then, it occurred to me: 'This is the fruit of three [kinds of] deeds, the result of three kinds of deeds that I now possess such great power and influence. These are: giving, taming, and comprehensive restraint.'"
The Blessed One spoke on this matter. In this regard, it is said:
"One should train in only good deeds, whose pleasant consequences stretch for a long time to come; Giving, and wholesome conduct, and developing a mind of loving-kindness.
Having developed these three mental qualities, which produce happiness; The wise one is reborn, in a friendly, happy world."
This matter too was spoken by the Blessed One, as I have heard.