When they finally rolled up our team, after 27 years, the person with the least seniority had ten years.
It's entirely possible to keep folks for long periods of time, but it requires some pretty serious management chops, and those skills are not exactly encouraged, in today's world; in any field -not just software development.
I worked for a Japanese company. The Japanese wouldn't even acknowledge my employees until they'd been around for a year. Having the same people on hand, year after year, was pretty much required, as our projects always took the long view.
I can't even imagine having an environment where engineers are expected to quit every year and a half.