Our Gemara on Amud Aleph tells us why Rabbi Yochanan would stand up and honor a gentile, elderly person:

רַבִּי יוֹחָנָן הֲוָה קָאֵי מִקַּמֵּי סָבֵי דְאַרְמָאֵי. אָמַר: כַּמָּה הַרְפַּתְקֵי עֲדוֹ עֲלַיְיהוּ דְּהָנֵי. רָבָא מֵיקָם לָא קָאֵי, הִידּוּר עָבֵד לְהוּ.

Rabbi Yoḥanan himself would stand before Aramean, i.e., gentile, elders. He said: How many experiences [harpatkei] have occurred to these individuals. Rava would not stand before them, but he displayed reverence to them.

Presumably, Rabbi Yochanan and Rava's rationale stems from a belief that someone who has lived that long must have successfully negotiated many challenging situations in life and has therefore acquired valuable wisdom. This explanation is self-explanatory, and also the Arukh says it explicitly, translating "harpatkei" as difficult times. So, according to the Arukh, it is not the accumulated wisdom of life experience, both good and bad times, but specifically the wisdom acquired from difficult times. While we do not look for painful experiences, the adage is still true: whatever does not kill you makes you stronger. And yes, it is the painful experiences that are often the most educational and growth-inspiring.

Rashi here emphasizes a different point about the elderly person’s life experience. While he does agree that the translation of “harpatkei” is difficult times, he adds an extra point. Rashi says that this elderly person must have gone through difficult times and witnessed miracles and wonders. So, according to Rashi, it is not referring to the accumulated wisdom from going through the painful experiences. But rather, it is the gratitude and awareness of God through lived experiences and salvations that makes this elderly person a source of wisdom. Rashi is differentiating himself from the simpler peshat, and this must be because he feels that wisdom alone is not worthy of honor. It must be wisdom with recognition of God.

A while back, I heard an interview with the conservative pundit, Dennis Prager. Apparently, he had a meaningful Jewish education as a child. During the secular interview, he quoted a verse in Hebrew and translated it, saying he learned this in Jewish day school, said it every morning as part of the liturgy, and it is a fundamental point about the use and misuse of intelligence. He quoted the verse in Tehilim (111:10):

רֵ֘אשִׁ֤ית חׇכְמָ֨ה ׀ יִרְאַ֬ת ה׳ 

The beginning of wisdom is the fear of the LORD;

Dennis said, in order to truly acquire wisdom, one must incorporate appropriate humility and fear of God.

Readers can go to the 15-minute mark and listen for about a minute to hear it live: 

Dennis Prager Reishis Chochma

Dennis, you taught me some Torah, so I’ll be standing up for you.