Govt works exactly the same way. You think they spend more than they take in by ignoring the excess is lent to them by investors - even the govt is taking in more than it spends.
If you're considering the Fed, it too is a lender, and has a zero net asset sheet.