A sale of real property has 3 components: the property price, the costs of closing the transaction, and any prepaid items related to the property.
Generally, the lender of the Buyer (the Borrower) pays all the prepaid items. Typically, these are house insurance, escrowed amounts for house insurance and taxes. During the latter part of the year, the taxes are also prepaid. The Buyer and Seller prorate the taxes due, based on when the closing is during the year -- the later in the year, the less the Buyer contributes.
The closing costs include fees charged by the lender, costs incurred related solely to the loan, like appraisal, survey, flood certification and so on. In addition, buyers usually demand title insurance to protect their ownership of the property. (This is not homeowners insurance. It is designed to cover underdiscovered liens or claims on the property itself, not house or liability perils.) Also, the escrow agent or title company charges for its services. As pointed out, these items are all negotiable prior to signing a contract as to who will pay for what.
Customarily, the Seller pays for title insurance and may also contribute toward the Buyer's other costs. Title expenses, other than title insurance, are usually split in half, but recording fees and the like typically belong to Borrower/Buyer. Prepaids almost always wind up on the Buyer's side.
Can you convey a property without paying any costs other than the sales price? Possibly, but there are pitfalls. Deeds should be prepared by competent legal counsel, otherwise they may not stand up or other unexpected consequences may result. The costs of document preparation are nominal and highly recommended. While not required, title insurance or at least an opinion of legal ownership from an attorney is essential. Part of the title insurance is the cost of doing a title search to warrant title in the property.
Recording is also essential. Once title has transferred on paper, without recording the event, it is conceivable that another transfer can be recorded first and override the deed. Title companies take great care to ensure deed and other closing documents are properly prepared and recorded in a timely fashion. Inspections and survey, even though the lender may be very interested in them, really give the Buyer some degree of assurance of the location of the property, any possible encroachments on or by the current owner, and the condition of the property. Lenders may not always require a survey, but an inspection is recommended for the Buyer's peace of mind.
The loan-related fees might be rolled into the loan and disappear as separate line-items, but the functions are still performed. The Borrower's loan officer needs to make a living, the person who processes the loan documents, the underwriter, the people who check on back taxes, the people who check whether the property may be at risk for flooding, the drivers who shuttle documents back and forth, and of course any credit checks. Yes, it is a long list, and often people deprecate them by referring to them as "junk fees" but they are actual costs borne by the lender. Some lenders hide them completely from view and call their loans "zero closing cost" mortgages, but Borrower's still pay them -- just not openly.
You'll have to make the judgment call as to whether you want to pay the costs of closing, but you might start by talking to a title company and explain to them what you want (and why you don't want a particular service performed). Lenders will be less than receptive to short-cutting the process, though. So, a Borrower will have a difficult time avoiding costs, although he may not know he is paying for them. And a Buyer who does not cover all the possible ways a conveyance can go wrong, may wake one morning on the street.
Who pays for the closing costs between Buyer and Seller is generally negotiable.