How does the fed pay these programmers more than the normal federal compensation schedule? Is the compensation uncapped if they work through a contractor? If they dont, why do these programmers choose to work there?
If you got a Ph.D. in some field and wanted to do R&D in it without trying to go tenure-track, then the national labs, and occasionally the contractors, used to be a decent compromise. Bell Labs was gone, Google wasn't yet running its moonshot factory, and Softbank had yet to open its pocketbook. Depending where in the country you want to be it still might make a little sense.
But if you're a programmer without a scientific speciality, then there's less reason.
The contractors have some freedom to pay as they see fit -- they pay more than the national labs in my experience -- but they still have to justify their rates to the government during contract negotiations, and the government can push back. The pay is "ok", but has been falling increasingly behind "Tech". So now there's brain drain, particularly among programmers.
I have limited first-hand experience, but yes, contractors can be paid independently of government pay scales as far as I know, and far more than you'd think (in terms of breadth of jobs) is done by contractors. I remember reading that the people who do security clearance investigations largely are, or were, contractors.
My impression is that if you do work directly for federal or state government, you also are likely to be alongside a substantial number of contractors.
That was the common transition where I worked. Do gov stint, get into a great office, establish a name for yourself and get the right access. Then transition to contract, bounce between them as they contracts are merged / transfered etc. but still make multiples greater than as a Civilian. Some billets were GS 9-13. Only difference was education background, same work same tasks. Same contract could be making 135k base plus profit share or guaranteed bonuses. The sky was the limit for some specific people (though not everyone got these offers, just like most won't get a FAANG job).
Multiple programs were built to fix the compensation for military members whom were paid even less than civilian counterparts in the same offices. It's why the churn rate is so high. Even then, the majority of cleared jobs still aren't commensurate with external salaries.