Pay is part of it, but exit interviews point more often at the absence of a technical career path and the frustration of decisions overturned upstream.
What retains people
Clear mandates, working equipment and budgets, and a route to seniority that does not require becoming a generalist manager.