Amazon (NASDAQ:AMZN) sees a big opportunity in India, where it already sells $8 billion worth of goods annually through its marketplace. Only Flipkart can boast greater online market share in the country. And while Amazon has expressed interest in buying a stake in Flipkart, it appears very likely Walmart will swoop in and acquire a big chunk of the company in the near future.

A cash infusion for its rival would certainly present a challenge for Amazon. But the company's core North American operations and cloud computing division continue to produce billions in free cash flow that it can use to fund operations in India and other emerging markets. India is particularly worthwhile, as analysts expect online sales there to grow from $30 billion last year to $200 billion in a decade.

After missing out on Flipkart, Amazon is planning to invest more in groceries, which is already the largest product category on Amazon in terms of number of units sold in India. The head of Amazon in India, Amit Agarwal, said he expects to launch two-hour grocery delivery at some point in the future. Groceries could pave the way for broader e-commerce growth in the region.

An AmazonFesh grocery order on a kitchen counter.

Image source: Amazon.

Building on its lead

Amazon launched grocery deliveries in the city of Bengaluru in southern India more than two years ago, and grocery unit sales across its geographies have quickly grown since then. Flipkart tried and failed to launch a grocery service in 2015, and relaunched a pilot program late last year. In the meantime, Amazon has built up a strong base of online grocery shoppers.

Expanding its grocery selection and offering fast grocery delivery to more customers will expand Amazon's lead over Flipkart and further build its association with online groceries. If Amazon can establish itself as the destination for online grocery shopping, it can get a lot of repeat orders and build customer loyalty.

Amazon is currently winning over Indian shoppers by offering Amazon Prime for just 999 rupee (about $15) per year, and it could offer a similarly low-priced subscription for unlimited two-hour grocery delivery. Amazon said more people signed up during the first year of Prime in India than in any other geography in its history.

Building infrastructure and demand at the same time

Regular grocery deliveries will support Amazon's investment in delivery infrastructure and logistics, which is still well behind developed markets. Of course, it's a bit of a chicken-or-egg scenario, where it's hard for Amazon to build infrastructure without the demand. As such, rolling out grocery delivery by geographic region in India can help it invest most efficiently.

That's not to say Amazon won't be losing a ton of money in India for years to come. Agarwal admits profitability is still years away. With Walmart potentially adding billions to Flipkart's coffers, the intensity of competition will only increase over the next few years. Ultimately, however, that could spur even faster growth in online sales in India as the two companies offer consumer-friendly services and pricing while helping build out the necessary infrastructure to make online commerce feasible for more people.

With an opportunity to take a big chunk of $170 billion in gross merchandise volume growth over the next decade, Amazon is smart to invest in its strengths. It's found success with grocery deliveries in India already and doubling down could strengthen the online retailer's leadership in that category. Still, Amazon will be investing billions in order to support quick deliveries and an excellent customer experience.

But Amazon investors aren't looking for profits anytime soon, right?