How does the goverment know how much to with hold from your employment check?

Income tax withholding is based on your income and the number of dependents you report.