In some areas of the country, the seller orders an inspection before the home is offered for sale. In other regions, the buyers order an inspection after they negotiate a purchase agreement with the seller. Who pays for the inspection is negotiable and is often determined by local custom. Who pays for the repairs depends on market conditions, lender requirements and the condition of the property. If you, or your agent, have any qualms about accepting a report that the seller paid for, order another inspection from a company you have confidence in before you remove your inspection contingency from the contract.
Some sellers have corrective work done before their home goes on the market.
Others have the work done between the time the sale is negotiated and when the transaction closes. Another option is for sellers to credit money to buyers at closing to cover the cost of repairs. The buyers can then have the work done later. Sellers who have termite work done before their listing goes on the market might have an easier time selling. Suppose a deck is rotted to the point that it's hazardous.