Well here's how costs are built up:
Direct costs = actual dollars per hour paid to workers (this does not include labor fringe benefits, labor overhead etc), actual invoiced components be it raw materials or assemblies from subs, and so forth.
Indirect costs = labor fringe, labor overhead, , etc...things that aren't directly attributed to the job but still necessary/recquired.
Overhead = everything else that is a function of the company that can't be directly billed to the project. This would include the human resources department, the IT department, physical locations other than where the work is done etc. Overhead is going to be added as a % of revenue based on the companies projections of how much they will be spending on overhead that year, and how much revenue they expect. What it actually ends up being is going to be different than projected because it's based on best guesses and historicals.
The contract specifies what is, and what is not allowed to be charged towards indirects costs. This typically includes not being to include ALL of a companies operations overhead as a way to extrapolate overhead.
Fee: The fee is the profit % for direct and indirect costs. You don't profit from overhead. It's not unusual for the fee for directs and indirects to be different from each other ie a fee of 7% on direct costs and a fee of 5% on indirect costs.
For mega billion dollar contracts where there is more than one competitor, the fee is probably going to be tight, 3.97% maybe, 4.11%, or whatever%...that's up to the bidder.
Since you aren't profiting from a significant portion of the contract (overhead) your effective net profit is cut in half or.... around 2%.
I've seen gross profit margins of 14% or more on projects that were actually losing money. Gross profit is a misnomer to me, because people equate profit with cash in pocket, and gross profit is not that.
In any event, if you can't sleep tonight (or any other night) you can find the Federal Acquisition Regulations here:
https://www.acquisition.gov/far/
I'm careful to be specific about this only because I've seen so many people counting money and they didn't understand how it actually worked. Most employees for instance actually think that if they are paid $10 per hour and a company charges $25 per hour for that employee, the company is "making" $15 per hour from their efforts. In reallity, that $10 per hour employee actually costs the company $20 per hour or more, and by the time all other costs are factored in that employee is only making the company pennies to the dollar.
Anyway to answer you more specifically Feanor, modernization is going to be at the cost of the contractor, that's just how it is however...... understand that physical plant upgrades (may be a new builidng, may just be upgrading the companies network hardware) are ammoratized and will be part of the operating costs that go into overhead.
So for you guys that understand some accounting principles, a typical fee for direct costs is going to be as I said previously based on competition and so forth. I would expect for a multi billion dollar contract the fee schedule to be in the 5% or less range.