While most sectors have struggled to generate returns this year, pharma stocks have emerged as one of the market's best-performing defensive bets. The Nifty Pharma index has gained about 6% year-to-date, sharply outperforming broader markets. In comparison, the Nifty is down 11%, Nifty IT has fallen 24%, while both Nifty Bank and Nifty Auto have declined around 8% over the same period.The outperformance has come at a time when investors have been grappling with geopolitical tensions, tariff uncertainties, slowing corporate earnings growth and concerns over global economic momentum.Several pharma stocks have delivered double-digit returns despite the challenging backdrop. According to data as of June 9, Gland Pharma has surged nearly 33% this year, followed by Wockhardt at 30%, Laurus Labs at 29%, Aurobindo Pharma at 22%, JB Chemicals at 21%, Zydus Life at 21% and Torrent Pharma at 16%.In contrast, traditional heavyweights such as IT services and financial stocks have struggled amid concerns over global growth and slower discretionary spending.Domestic business provides stabilityA major reason for the sector's resilience has been strong growth in India's domestic formulations market. According to Kotak Equities, most large Pharma companies reported double-digit domestic growth in the March quarter, supported by healthy demand across both chronic and acute therapies.The brokerage noted that cumulative domestic growth for its pharma coverage universe stood at 14% year-on-year during the quarter. Companies such as Dr Reddy's, Torrent Pharma, Sun Pharma and Cipla reported some of the strongest growth rates.Unlike export-oriented sectors that remain vulnerable to tariff risks and global demand fluctuations, Indian pharma companies derive a significant share of revenues from domestic healthcare spending, which has remained robust.Global healthcare tailwinds strengthen outlookBrokerages also remain positive on the sector's long-term prospects. Bernstein recently initiated coverage on six major pharma companies and identified Zydus Lifesciences, Lupin and Sun Pharma among its preferred picks.The brokerage believes healthcare will benefit from several structural trends over the next decade, including ageing populations, rising healthcare spending, obesity treatments, preventive medicine, vaccines, digital healthcare and artificial intelligence-led innovation.Bernstein estimates that incremental innovation could expand the size of India's biopharma industry to nearly $195 billion over the next decade, almost four times current levels.The brokerage also expects AI adoption to improve operational efficiency across the sector, potentially adding three to four percentage points to profit margins over time.Valuations still reasonableDespite the rally, analysts argue that valuations remain supportive. Bernstein noted that pharma sector valuations have risen slightly above their 10-year average but investors are still largely pricing in domestic growth and challenges in the US generic drug market. Emerging opportunities in innovation, specialty products and emerging markets are not fully reflected in current valuations, the brokerage said.Kotak Equities also highlighted that while US business remains weak due to pricing pressure and the decline of blockbuster generic opportunities such as Revlimid, domestic growth, Europe and other international markets continue to provide support.Defensive sectors back in favourThe broader market backdrop has further strengthened the appeal of Pharma companies. Investors have increasingly sought shelter in sectors with stable earnings visibility as concerns mount over the impact of the Iran conflict on crude oil prices, uncertainty around global trade policies and signs of a slowdown in corporate earnings growth.Unlike cyclical sectors that are heavily dependent on economic growth, pharma companies offer relatively predictable cash flows and are less sensitive to swings in commodity prices or consumer sentiment.That has made the sector one of the few pockets of the market generating positive returns at a time when many of the benchmark indices remain under pressure.China risks could create fresh opportunityAnother trigger that could well play out in the future is from geopolitical developments involving China. Recently, the US Department of Defense added several Chinese companies, including contract drug manufacturing giant WuXi AppTec, to a list of entities linked to the Chinese military.Elara Securities said the move is sentimentally positive for Indian contract development and manufacturing companies because it could encourage global pharmaceutical firms to diversify supply chains away from China.While Elara cautioned that any meaningful business shift would take years due to the complexity of pharmaceutical manufacturing transfers, investors have started factoring in the possibility of India gaining market share in global outsourcing.Indian players such as Divi's Laboratories, Laurus Labs, Syngene and other CDMO companies have been among the beneficiaries of this theme.With domestic demand staying strong, global healthcare spending rising and fresh opportunities emerging from supply-chain diversification away from China, investors appear willing to continue paying a premium for the stability offered by pharma stocks.Data: Ritesh Presswala(Disclaimer: Recommendations, suggestions, views and opinions given by the experts are their own. These do not represent the views of Economic Times)