Not all types of businesses necessarily require the establishment of a legal entity in mainland China. In some occasions, distribution agreements or a representative office may be sufficient; a company registered in Hong Kong SAR may also be an option.
Whether a legal entity is needed in mainland China depends on your business, your objectives, as well as the specific industry in which you operate. In general, it is needed for businesses that require payments to be made and received in China without paying intermediary fees, for businesses that require a large number of employees in the country, as well as for businesses involving production activities.
It is also noteworthy that many foreign investors choose to register a company in Hong Kong SAR as an entry point to mainland China. The advantages include: less market entry restrictions, the use of English as official language in contracts and business, internationally-renowned litigation and arbitration mechanisms, free movement of capital and people, as well as generally easier access to capital.