Most defense industry contracts are awarded to the low bidder, so contractors underbid just to continue operating. But then that leaves them without sufficient revenue to pay market rate wages to employees with the specialized skills to deliver on the contracts. Most defense companies still manage to muddle through somehow but it's messy.
Contracts where all profits scale 1:1 with costs are a relatively small slice of total spending due to obvious poor incentives.
Fuel and similar commodities may look kind of like a cost+ contract, but it’s market price + X$ not market price * some profit margin so the incentives are different. It’s a net win for both sides if such variables are removed from the equation.