The reason for these factory-compounds is because China has challenging export quotas to places like the US and EU. But concentration of manufacturing know-how remains in China. The only way for these businesses to keep selling to high-value markets is to move manufacturing to another country where there is available quota. Although the goods are 100% made by Chinese, they are 0% made in China.
The Chinese government encourages business in this area because it is good employment for the Chinese. In turn, these businesses need better infrastructure in the countries they operate in. The infrastructural investment in these other countries is a wonderful side-effect that the government is happily playing up as part of its diplomatic strategy. When the textiles and the shoes and the fabrication factories are no longer making money, hopefully the ports, the trains, the roads, the power grid will continue generating interest income for the Chinese banks. And the recipient countries of these gifts, as it were, may extract benefit from this arrangement, eventually.