Of course, an armada could not just sail into an Indian city and expect to find enough supplies at hand in the city’s spice markets to load up five or ten large ships at once. Should it even try, it would likely provoke an instant scarcity and quickly drive up the prices of spices astronomically.
Instead, the Portuguese relied on the ancient ‘factory’ system. That is, in every major market, the Portuguese erected a warehouse (‘factory’, feitoria) and left behind a purchasing agent (‘factor’, feitor). The factor and his assistants would remain in the city and buy spices from the markets slowly over the course of the year, and deposit them into the warehouse. When the next armada arrived, it would simply load up the accumulated spices from the warehouse and set sail out at once.
The first Portuguese factory in Asia was set up in Calicut (Calecute, Kozhikode), the principal spice entrepot on the Malabar Coast of India in September 1500, but it was overrun in a riot a couple of months later. Consequently, the first lasting factory was set up in the nearby smaller city of Cochin (Cochim, Kochi) in late 1500. This was followed up by factories in Cannanore (Canonor, Kannur) (1502) and Quilon (Coulão, Kollam) (1503).
Although some Portuguese factories were defended by palisades that eventually evolved into Portuguese forts garrisoned by Portuguese troops (e.g. Fort Manuel was erected around the Cochin factory in 1503, Fort Sant’ Angelo around the Cannanore factory in 1505), not all did. The two concepts are distinct. Factories were commercial outposts, not political, administrative or military. The factor was formally an employee of the Casa da Índia (the trading house), not an officer of the Estado da Índia (the colonial government).