The government nearly risked running out of money before a deal on the debt ceiling was brokered by President Joe Biden and House Speaker Kevin McCarthy.