It can but then they are heavily dependent on external sources of food, water, raw materials, manufactured products, etc. that are outside of its control. This gives the outside nations who are supplying those things larger influence on the domestic and foreign policy of the city-state because they can raise costs of imports or even embargo them to pressure the city-state to align with their own foreign policy goals.