"Grass is greener" is a strange label to use for the ability of even mediocre developers to get $50K+ raises by switching jobs, while the industry as a whole remains myopic about giving comparable pay increases to existing employees.
I've seen it happen many times. People who got promotions after promotions and are paid absurd amounts, and after 2-3 years will jump ship anyway, often with a pay cut to join their friend's little startup.
Which is fine, its their choice and if they like that better, they certainly can go for it. That doesn't change that it's basically cultural at this point. Software engineers jump ship really quickly, even if everything's perfect (which, admittedly, is rare). I've done it many times myself.
If companies had better career paths and gave good raises that might be longer.
I worked with a lot of great people, but years of sustained 80-100 hour work weeks, getting called on the rare vacation and the inability to have a personal life (only dated for a total of like 5 months in the 9 years I was there). I didnt get married until 5 years after I left, and ironically to the exwife of a former coworker from the same firm. The pisser is that I was grossly underpaid for 7 of those 9 years. I was taken advantage of because I was a mew hire directly out of college. After several years, I realized this as I became a defect team lead and assumed about 13x the responsibility I was hired for within 2 years. It took a written offer from well, Amazon, to get my pay adjusted. I got a 50% pay increase midyear to stay... Ive since moved on, and honestly, not sure which decision I regret. I'm still in finance, but a lower stress firm, with a dead simple commute, typically 40 mins in the car tops per day, round trip. Id be far happier if I was suffering from the pain of accumulated medical issues.
5 years is pretty darn high by tech company standard, as people already mentioned. Partly because of the culture of "you have to jump ship to make more money and promotions", but even the most employee friendly company will barely edge that, just because software engineers have a huge "grass is greener" syndrome.