The Buddha shares a simile of a mountain to illustrate the inevitability of old age and death, and the importance of living by the Dhamma.

Pabbatūpama sutta - Simile Of The Mountain

At Sāvatthi.

When King Pasenadi of Kosala was seated to one side, the Blessed One said this to him: "Now where are you coming from, great king, in the middle of the day?"

"Venerable sir, there are crowned noble-warrior kings, who are intoxicated with the vanity of power and overcome by greed for sensual pleasure, who, having conquered a vast territory, dwell as rulers. I have been engaged in attending to the affairs of these kings."

"What do you think, great king? Suppose a man were to come from the eastern direction, a faithful and reliable person. Approaching you, he would say this: 'Great king, you should know that I am coming from the east. There, I saw a massive mountain, towering as high as the clouds, advancing while crushing all living beings in its path. Whatever needs to be done, great king, you should do.

Then, a second man would come from the western direction ... Then, a third man would come from the northern direction ... Then, a fourth man would come from the southern direction, a faithful and reliable person. Approaching you, he would say this: 'Great king, you should know that I am coming from the southern direction. There, I saw a massive mountain, towering as high as the clouds, advancing while crushing all living beings in its path. Whatever needs to be done, great king, you should do.'

Great king, when such a great and terrifying danger arises one that is dreadful, leading to the destruction of human life, and where the human state is hard to attain what should be done in such a situation?"

"In such a situation, venerable sir, when a great and terrifying danger has arisen one that is dreadful, leading to the destruction of human life, and where the human state is hard to attain what else should be done, other than living by the Dhamma, other than practicing wholesome conduct, other than performing beneficial actions, and other than making merit?"

"I inform you, great king, I declare to you: Old age and death are advancing upon you, great king. When old age and death are advancing upon you, what should be done in such a situation?"

"When old age and death are advancing upon me, venerable sir, what should be done in such a situation, other than living by the Dhamma, practicing wholesome conduct, performing beneficial actions, and making merit?

Venerable sir, there are elephant battles [fought by] crowned kings, who are intoxicated with the vanity of power and overcome by greed for sensual pleasure, who, having conquered a vast territory, dwell as rulers; but there is no place for those elephant battles, no scope for them, when aging and death are advancing [upon me]. There are, venerable sir, cavalry battles [fought by] crowned kings ... there are chariot battles ... infantry battles ... but there is no place for those infantry battles, no scope for them, when aging and death are advancing [upon me].

Venerable sir, in this royal court [of mine], there are ministers and chancellors who, when enemies approach, are capable of dividing them with wise counsel. But there is no place for those diplomatic battles, no scope for them, when aging and death are advancing [upon me].

Venerable sir, in this royal court [of mine], there is an abundance of raw gold and gold coins, both stored underground and kept in the treasury, with which we are able to entice approaching enemies through wealth. But even for those battles fought with wealth, there is no place, no scope, when aging and death are advancing [upon me].

When old age and death are advancing upon me, venerable sir, what should be done in such a situation, other than living by the Dhamma, practicing wholesome conduct, performing beneficial actions, and making merit?"

"So it is, great king! So it is, great king! When old age and death are advancing upon you, what else should be done, other than living by the Dhamma, practicing wholesome conduct, performing beneficial actions, and making merit?"

The Blessed One said this. Having spoken thus, the Well-Gone One further said this:

Just as mountains of solid rock, towering to the sky; Might advance from all sides, crushing everything in the four directions—
In the same way, old age and death, overwhelm all living beings; They strike down warriors, priests, merchants, and even outcasts and scavengers; They spare no one, crushing everything in their path.
There's nowhere for elephants to take a stand, nor for chariots, nor for infantry; Neither can one win with wits, nor with wealth can one defeat them.
Therefore, the wise person, seeing what is good for oneself; Steadfast, should place their faith, in the Buddha, Dhamma, and Saṅgha.
One who lives by the Dhamma, in body, speech, and mind; is praised right here in this life, and, upon passing on, rejoices in heaven."