India has a population of more than 1.3 billion people, with about 42% of its population vaccinated. Considering it still, has a long way to go in vaccinations and the potential requirement of a booster shot especially for its elderly population why does India continue to donate vaccines to other countries?
I am interpreting this question more broadly than "why did India do this thing?" I am answering the question "Why do countries sometimes do things that seem to be against their interest but help other countries?"
In the book Systems of Survival by Jane Jacobs, she holds the thesis that government action (she calls it "guardian" action) and private action (she calls it "trade" action) should properly follow different systems of ethics. She calls them syndromes.
The trade side is appropriate to such activities as being a store owner, running a factory, being a school teacher, and many other things. The basic point is, it is private activities intended to earn a living through exchange of some kind. In the trade column there are rules like being industrious and productive, being thrifty, investing for the future, being open to innovation, being optimistic, and shunning force, and several other items.
In the government side there are things such as being loyal to the heirarchy, treasuring honor, keeping tradition, being ostentatious, taking revenge, and several other items.
The idea of these syndromes is, if you follow all of the rules that apply to your kind of activity, you will tend to get a stable system. If you don't follow your correct set of rules, things break down quickly. She gives several examples, such as the mafia following several rules from each side. They are industrious and innovative, but also care deeply about honour, the heirarchy, and taking revenge.
One of the imporant things a government should do is distribute largesse. This is the giving of favors with the intent of either rewarding past good deeds, or encouraging future good deeds. It is different from a gift in that it is intended to encourage specific future good deeds for the government giving out the largesse.
Some examples of largesse might be: People are promised great benefits such as free health care and free university if they sign up to be in the army. A general comes back from the wars with a huge victory, and he gets titles and land from the king. Or, a political ally is instrumental in helping to win an election, so he gets a cabinet position.
In this specific case, India is dispensing largesse. They are giving away this thing in the expectation that it will produce benefits in terms of friendship and loyalty that help India. This may be from the specific governments being benefitted. Or it may be from the media in various countries that see this and thus produce positive stories about India. Or it may be so they can pull prestige away from other countries, countries that might not be able to dispense such largesse.
They are doing this because the system of ethics that causes a government to tend to survive includes the dictum to dispense largesse.
Well, Indian companies have been contracted to produce Western vaccines for the 3rd world, such as through the Covax programme (mostly the Astra Zeneca vaccine, but also some Novavax). I'm not totally familiar with the details of the deal, but probably part of the reason why India got the "recipe" for Western vaccines at all (to produce locally) is that it agreed to this scheme.
India is also in a bit of a diplomatic race/rivalry with China so that probably played a role too in them agreeing to supply other countries, especially neighboring ones like Bangladesh and Nepal, which can be considered in India's "sphere of influence".
However, when the Delta outbreak overwhelmed India this spring, they basically suspended the exports, which were only resumed a few days ago.
Serum Institute had contracts to provide COVAX with 200 million doses of AstraZeneca vaccines, and unfinalised agreements to supply 350 million more. The suspension was a significant setback for global efforts to distribute vaccines equitably.
GAVI, the vaccine alliance which co-manages COVAX, said the company had provided just less than 30 million doses to it.
With new infections in India at the lowest level in months, Serum resumed exports on Friday [Nov 26]. Its shipment to Tajikistan under the COVAX initiative was the company’s first in seven months. [...]
The resumption came after the institute exceeded its original target to produce 1 billion doses of the vaccine branded as Covishield by the end of the year, the company said in a statement. It has produced more than 1.25 billion doses so far.
According to other news from Nov 18, India seems to have more of a shortage of syringes nowadays, of which they've recently limited exports.
Also, it appears that (like in some Western countries), vaccine hesitancy has resulted in some unused stockpiles in India too, e.g. other news:
NEW DELHI, Nov 17 (Reuters) - Indian states are sitting on more than 200 million doses of COVID-19 vaccines due to a reluctance among people to get inoculated, the chief executive of top vaccine maker the Serum Institute of India (SII) said on Wednesday.
It's actually hard to find concrete numbers on [true] vaccine hesitancy in India. There are (some) lenghty but rather wishy-washy articles that don't have firm conclusions/data--the only clear part being that there's been less vaccine uptake in rural areas. According a Facebook-based survey from August (which probably isn't too reliable), some 29% of Indians had expressed hesitancy, with wide variation between the Indian states (from 15% to 40%). According to another on-line (LocalCircles) survey, that number might be only 7% in October. That's a pretty wide discrepancy, so it's hard to say what's truly going on.
To add some clarifying points here based on the follow-ups in the comments.
The government of India also made some direct donations of vaccines, e.g. to UN peacekeepers, some 200,000 doses in March (before India had a big Delta outbreak). The point of this more direct donation was that the peacekeepers would not have to wait for Covax. (And yeah, there were 100,000 UN peacekeepers at least in 2019. Not sure on their present number, but considering troop rotations etc., I'm not surprised they ran out of the vaccine stock in September--which was the topic of the first article linked by the OP.)
The Indian MEI page does specify which vaccines were donated (by India) through Covax and which were direct donations (somewhat confusingly there's a "commercial" category in between them). According to that page, as of Nov 30, there were 12.7 million vaccines given as direct donations by India and 21.3 million thorough Covax. These numbers (thus) don't seem to include (all the) vaccines paid for by Gavi. I'm honestly not 100% sure how to interpret the Covax column in that table in terms of who paid for those, but the (1st) "grants" column certainly lists the direct donations, because e.g. the shipment to the UN peacekeepers is in that column. There were an additional 38.3 million doses exported "commercially", by the way.
If those export numbers (from India) seem big, they pale in contrast to what China has (apparently) exported... just by the 1st week of August
With COVAX sidelined, vaccine donations have become something of a political contest. China has already exported 770 million doses and last week announced its own goal of sending 2 billion doses to the rest of the world by the end of the year — exactly the same amount as COVAX's initial plan.
According to a BBC tally in October, China indeed had exported some 1.2 billion doses by then, 1.1 billion of which commercially. That article also has this helpful graph comparing domestic production with exports by the 4 major "competitors" (data for/from Russia was said to be too uncertain to include):
That article also says "India had exported about 66.4 million doses of its locally-made vaccines as of the end of May, when exports were suspended." (That's both donations and commercial combined.) Using the latest (Nov) figures from MEI, they have exported 72.3 million doses (in all categories combined), so less than 10 million doses since May, i.e. the suspension (due to their Delta outbreak) had a serious impact on Indian vaccine exports.
It is a diplomatic move. India has donated vaccines to over 90 countries. The numbers may not be a lot. These countries - leaders and people are thankful regardless and some day if India needs help, they will provide the help they can.