At every reasonably well-run company I've worked for, the "useless" people were steadily sifted out of the company, either through PIPs or routine layoffs.
That doesn't mean you had to monotonically increase your workload forever until you were crushed, but it did mean that management routinely did basic performance management and would look deeper into people or groups that weren't really doing anything (including maintenance, upkeep, and routine tasks that don't necessarily involve new features).
Another common technique is to periodically restructure and shuffle teams around. It may be easy for someone to wiggle into a position where they can be useless while fooling their manager, but it's much harder to maintain this state across multiple teams and even divisions.