Proration
At closing, certain costs are often prorated (or distributed) between buyer and seller. The most common is for property taxes. This is because property taxes are typically paid at the end of the year for which they were assessed. Meaning, if a house is sold in June, the sellers will have lived in the house for half the year, but the bill for the taxes won't come due until the following year! To make this situation more equitable, the taxes are prorated. In this example, the sellers will credit the buyers for half the taxes at closing.
I believe, this gives you the basic outline and idea about closing costs. Feel free to visit my website or call for more information in the area you are purchasing.