It isn't that hard, really. They had a massive population in relative destitute poverty that was willing to work very hard for a small, but significant, increase in their quality of life, starting with Deng Xiaoping's market reforms through fairly recently.
The surplus of cheap labor is shrinking, and the current "made in China 2025" plan is intended to drive the growth further by shifting more portions of their economy away from foreign services and goods.
The tactics are largely the same, though: massive subsidies to local companies that disadvantages foreign ones, tacit acceptance if not outright approval of theft of trade secrets from those foreign companies that do business in China, and until recently anyway, kept the yuan pegged to the USD, meaning that it is far cheaper to buy Chinese goods than elsewhere. Now, it is tied to a basket of currencies, but held in a fixed range, so it remains intentionally undervalued.
All of this put together ensures that foreign countries will buy Chinese goods and services, and that Chinese people will also prefer to buy locally.
Think of it as a "cold" trade war. Why they were allowed in the WTO with such policies I'll never know.