Determining the exact amount of withholdings you should be making in order to avoid any payment at tax time can be difficult to determine, so most people estimate what their expected liability will be. If the goal is simply to receive a refund, you may opt to overshoot your expected liability and get money back once the return is filed. In most cases however, this wouldn’t be suggested as you just end up giving the government an interest free loan.
The general rule of thumb in order to avoid an underpayment penalty, is to pay the lesser of 90% of the taxes you owe by the end of that year or an amount equal to 100% of your tax liability for the previous year.