If this is true then it's a recent development caused by changes in companies behaviour rather than anything intrinsic to engineers.
If you look at Bell Labs, HP, even Microsoft back in the day, engineers stayed there forever. The perennial example would be Steve Wozniak not wanting to leave HP.
What has changed since then is perhaps that companies now only do one thing and then specialize their people even beyond that. You need to allow some variation in work or anyone would get tired of it and leave. Even Google falls foul of this, you can change and work on any project as long as it uses the same infrastructure and is a web application, this doesn't compare well to Bell labs.
Most programmers are not ambitious by normal standards and tend to be risk adverse. As long as you don't make their job deeply boring or annoying they will literally never leave.