Anecdotally, all the devs I personally know who hopped around like this did so because promotions/compensation were stalled out at their current job. Almost all of them would have stuck around if offered competitive titles and compensation, but they were often being paid 25-50% less than they would be as a newhire at the same company.
This has been the case for most orgs I've been at, I tend to tie it to poorly managed growth and planning.
it's shocking the number of developers I've seen left standed in their carrer progression (to quit eventully) due to overhiring and ending up siloed away somewhere
but I guess that's just kind of the way it goes working for other people though