The money withheld for federal taxes and shown in box 4 of the Form 1099-R gets added to your withholding from all other sources and applied as a credit on Form 1040 line 64 or Form 1040A line 40 against your overall tax liability. Similarly, state taxes withheld get applied as a credit against your state tax liability.
You have a balance due when your overall tax liability exceeds your total of withholding and estimated tax payments.