Geopolitical problems and installation of US air defense systems in South Korea led to Chinese restrictions on South Korea. This led Samsung to reduce its labor force in China from 60,000 to 18,000 in 2023. It shifted operations to India and Vietnam. It is Vietnam's largest exporter and makes 20-30% of its global smartphones in India. Apple is only now beginning to shift to India. This is called decoupling or de-risking after an excessive concentration of manufacturing by companies like Apple in China.
Xiaomi took a large share of the local market in China from Samsung, another reason Samsung reduced presence in China. It still gets advanced components from China. In India Samsung has a dominant market presence. Because India is a price conscious market Apple has only a small market share in India.