Or the the rising wages in China means that building a fully automated line isn't as cost-prohibitive as it was in the past. And with states/cities throwing tax incentives at companies it doesn't matter where the automated line is so long as it can be integrated into the supply chain easily.
It's likely a combination of lower volume, like you state, cheaper automation, rising wages and some political incentives like tax breaks, etc.