The closing agent reviews the sale agreement to determine what payments and credits the owner should receive and what amounts are due from the buyer. The closing agent also assures that certain transaction costs are paid (taxes and title searches).
Closing is also the time when "adjustments" will be made. For instance, suppose you've pre-paid taxes four months in advance. In this case, the closing agent will compensate you for the prepayment at closing by having the buyer pay you additional money.
It could also work in reverse. If you are behind on property taxes, the closing agent will reduce the money due to you at settlement by the amount of the unpaid taxes.