This is case-specific on the contract side. Sometimes the contract is funded already and the mission critical workers (like military, critical systems IT staff etc.) will continue working.
And for anyone fomenting tears on behalf of the direct federal workers… Please realize that many of the lifers know and plan for this type of shit and even look forward to it. They will get back pay for however long it lasts so it is essentially a multi week paid vacation for them.
A large number of federal workers view this as a benefit of their mealticket.
(Source: worked in Federal contracting for a while)