Bombay passed to the EIC as a result of the Royal Charter of 27 March 1668, which essentially leased the settlement to the Company for an annual rent of £10.
That reason the EIC was able to obtain Bombay is because Charles II was quite short of money. England had recently fought a series of expensive wars against the Dutch and French. In this context, the cost of maintaining a significant outpost on the other side of the world was simply too high.
The Moroccan city of Tangier also passed from Portugal to England as part of Catherine of Braganza’s dowry. Charles later abandoned it in 1684 for the same reasons: the cost of maintaining a garrison, especially after the rest of Morocco was united under the Alawis, was simply too great.