Automation is orthogonal to demand. If demand isn't there then it doesn't really matter if the factory is automated or not.
And yes, China is aware of some slowing demand (although their exports are still impressive.) You can see this playing out in a couple ways.
Firstly they dominate production in key "future" technologies. Solar and EVs spring to mind as examples, but there are others.
Secondly they are investing in infrastructure (and goodwill) outside of China. Africa has a billion consumers-in-waiting.
While the US retreats from Africa (killing USAid, indulging racist theories about South Africa, etc), promoting isolationism (America First), activly alienating people via tarrifs, what is China doing?
China is quietly filling the void. They are building roads, ports, airports and other infrastructure. They are improving supply lines (Temu is expanding in Africa at a huge rate.) They are building cultural bridges, learning and teaching two very different cultures to work more easily together. In essence developing future customers, not antagonizing them.
It will be interesting to look back in 10, 20 or 30 years to see which strategy delivers better rewards.
What will the African customers pay with? Average income in Africa is maybe $200 per month. Chinese solar and EVs already lose money when factoring in capex and subsidies across the supply chain.