Spending = Taxes + Borrowing
This equation must hold at all times. The amount the government spends must be equal to tax revenue plus borrowing.* If Spending is $100, and Taxes is $60, then Borrowing must be $40 (100=60+40). Once spending and taxes are determined, borrowing is just the residual.
The silly thing about the debt ceiling is that it allows Congress to choose Spending, Taxes, and Borrowing without having to make the equation hold. Congress can tell Treasury to spend $100, raise $60 in taxes, and borrow $10, which is basically what Congress is doing when it threatens to not raise the debt ceiling. This forces Treasury to renege on existing spending obligations--obligations created by Congress!
This is why raising the debt ceiling used to be little more than a formality. Congress raised the debt ceiling 18 times during the Reagan administration and 7 times under George W. Bush.
So all the silly analogies you hear about how raising the debt ceiling is giving Obama a blank check, or whatever, are irrelevant. It's not a blank check; raising the debt ceiling just gives Treasury permission to honor legislation already passed by Congress. It's a stupid law, and it should be eliminated entirely--not used for political stunts.
*Obviously, I'm abstracting from seigniorage and other small sources of government revenue.