Step-by-step explanation:
Not all cities are. However, there are many cities that are. No city or country has all the raw materials needed for production, and most cities need to transport their products to other countries, therefore large ports are needed for ocean going vessels. Because of the number of jobs created in transportation and banking related to that trade, there is automatically a need for a city of size.
In order to be competitive, manufacturers place their businesses near ports to reduce transportation costs, furthering the economic cycle that leafs to population goth of port cities (and river cities, and cities on inland lakes that are connected to the ocean via rivers).