I do not know which planet you are on. A lot of technology companies - IBM, Nvidia, Broadcom, Cisco, Juniper, HPE (I know of these ones since I have done business with their American operations) have well run engineering organizations in India.
Apple is a little riskier in that it is a manufacturing operation. Given China's behavior, Apple gross margins they can take a bet here to shift portion of iPhone mfg to India. Apple could export 25-30 billion dollars in iPhones which is Pakistan's export figures for a whole year