What’s China doing in Sri Lanka? Officially, it’s building the country’s infrastructure. Like the ports of Colombo and Hambantota, which have left the country heavily indebted.
Unofficially, China is setting up outposts in the Indian Ocean as part of Beijing’s broader strategy to secure the passage of Middle East oil through the Strait of Malacca and counter American naval hegemony in the region.
China has increasingly come to rely on the Middle East for its oil needs, which must be shipped through the Strait of Malacca to reach its shores. This means that Beijing runs the risk of being cut off from Middle East oil supplies should America blockade the Strait -- in the event of a further escalation of South China Sea disputes or an outright war between America and China.

