Why china need to buy arms when he can manufacture locally
Because manufacturing is not developing! They can manufacture in an impressive way, but are still far behind the west and Russia in terms of R&D. That's why J11A might look like a Flanker, but is technically not on par with the Su 30 MKI or the Su 35. That's why their stealth fighter designs looks like Russian and US once, but are technically not on par either.
That's why their current puls doppler radars, avionics and missiles are not on par with Russias and US s most advanced counterparts, why they need to copy even missile, why helicopters like Z8 and Z9 are licence production version of French helicopters, why they use and still procure more Mi 17s in high numbers just as we are...
So when they only have access to limited foreign stuff and they are still not on par in terms of R&D, their only option to improve their forces and their indigenous industry is to spend huge ammount of money and reverse engineering!
India has the same aim of improving the forces and the indigenous industry, but is following a different way to get their. India can procure anykind of weapon and techs, but MoD also realised how important licence productions under ToT, offsets, JV s and co-developments are, because our indigenous industry is still only at the begining. That's why we procure most advanced foreign techs, with the maximum ammount of advantages for our industry (MMRCAs, LUH, LDPs...), while we push our industry to JV s and co-developments with foreign companies (Samtel JV with Thales, FICV privat JV s, Brahmos, FGFA, MTA, Barak 8, Maitri SAM...). Only in addition to that, we add specialised foreign arms to increase the capability of our forces (C130J-30, P8I, or Nerpa SSN...).
I have no doubt that China will surpass Russia and several western countries in R&D soon too, but the current situation of their forces and industry is not equal at all.
India has an even longer way to go, but the forces benefit a lot from the access to foreign arms today, just like our industry will catch up faster with foreign help.