One of the last things that a buyer wants to happen is for you to sell your company, and then turn around and start another one just up the street, taking most of your customers with you. For that reason, buyers will want you to sign a noncompete agreement as part of the deal. The agreement will state that in exchange for a specified payment, you promise not to go into a similar type of business, within a certain geographic area, for a given period of time. Sometimes the agreement will specify that you promise not to use certain confidential trade secrets, business processes, customer lists, etc. that you are transferring to the buyer.
Most sellers think of signing a noncompete agreement as a "no-brainer." They are retiring, and weren't planning to go into a similar business anyway, so why not take money for doing nothing? However, you should know that there's a sizable number of business owners who find, a couple of years down the road, that they got out of their business too early and they miss it. When they decide they want to go back into business, a noncompete agreement can stand in their way.
To be enforceable, noncompetes generally have to restrict you only from starting a business similar to the type you sold, in the same geographic area from which the former business drew customers, and must be limited to a reasonable (meaning, short) length of time. State laws generally discourage such agreements and in some states, they are virtually impossible to enforce.
But noncompetes have another purpose: to convey more cash to the seller, in a form that has tax advantages for the buyer. All noncompete agreements must be written off over a 15-year period, regardless of their actual length. Since most noncompetes are for five years or less (and must be short in order to be valid), this rule makes them much less attractive. Nevertheless, they are still used in a majority of business sales.