Assuming you own the Rise and Fall expansion, you most likely lost your city's loyalty, which can happen for various reasons:
- Your city is too far from your empire and too close to another's.
- You're in a Dark Age, and your neighbor isn't.
All cities start with 100 loyalty. Each turn, a city can gain or lose loyalty (or neither), but will never go over 100 or below 0. When the city reaches 0 loyalty (and negative loyalty per turn*), it will revolt and become a Free City. Free Cities don't belong to any civilization and are always at war with all civilizations.
Loyalty is mainly affected by "loyalty pressure". Each city exerts that pressure on all cities within a 9 tile radius. Pressure is affected by following factors:
- How many citizens the city has: more citizens exert higher pressure.
- How close the city is: the closer, the more pressure it exerts.
- The Age factor of the city's civilization (Dark Age: 0.5, Normal Age: 1, Golden/Heroic Age: 1.5).
Loyalty pressure provides between -20 and 20 loyalty per turn. Your own cities increase this value while foreign cities decrease it. When settling, you might notice a bunch of tiles with a label displaying a negative number ranging from -1 to -20. These labels are a warning that if you settle there, your newest city will be affected by a negative pressure and will eventually revolt if you don't counter it.
In addition to loyalty pressure, each city has several factors that affect its loyalty per turn:
- -6: Citizens are in "Unrest" (Amenity deficit of 3 or more)
- -3: Citizens are "Displeased" (Amenity deficit of 1 or 2)
- 0: Citizens are "Content"
- +3: Citizens are "Happy" (Amenity surplus of 1 or 2)
- +6: Citizens are "Ecstatic" (Amenity surplus of 3 or more)
- +8: You've assigned a Governor to the city (the governor does not need to be established yet)
- -2: A foreign civ has established Governor Amani with the "Emissary" promotion in a city within 9 tiles.
- +2 (Rise and Fall only): You've established Governor Amani with the "Prestige" promotion in a city within 9 tiles.
- +4 (Gathering Storms): You've established Governor Victor with the "Garrison Commander" promotion in a city within 9 tiles.
- +2: Limitanei policy (Military) and the city is garrisoned.
- +2: Praetorium policy (Diplomatic) and the city has a Governor.
- +1 - +6: Communications Office policy (Diplomatic) and the city has a Governor. +1 loyalty per Governor's promotion (Governors start with 1 promotion).
- +3: Colonial Offices policy (Economic) and the city is on a different continent than the capital.
Buildings & districts:
- +1: Monument (City Center)
- +8: Government Plaza district
- -2: Audience Chamber (Government Plaza) and city has no Governor.
- +3: Following the religion founded by the owner.
- -3: Following a religion founded by another civ.
- -5: The city is "occupied" and there is no unit garrisoned in it. The city will remain "occupied" until the previous owner has "ceded" it via a deal (usually as part of peace negotiations), or has been eliminated from the game.
- (Gathering Storms) Variable penalty depending on your Grievance with the founder.
- +4: English cities with a Royal Navy Dockyard on a different continent than the capital.
- +2: Spanish cities with a Mission adjacent to the City Center on a different continent than the capital.
- +3: Zulu cities with a garrisoned unit. +5 if the garrisoned unit is a Corps or Army.
- +5: Persian cities with a garrisoned unit.
- +1: Dutch cities for each active domestic Trade Route that started from that city.
+2: The city is within 6 tiles of the Colosseum (city and Wonder must belong to the same player).
-4: The city is starving (e.g. farms have been pillaged)
+10: The city is a Free City (not belonging to any civilization).
+20: The city is a city-state.
Some Great People can permanently increase loyalty per turn for one city.
+4 (Ethiopia Pack): If the Secret Societies game mode is enabled, the Owls of Minerva earn +4 Loyalty per turn when a Spy is in their territory once the Industrial Era is reached.
When a city becomes a Free City, its loyalty is reset to 100. If the Free City's loyalty reaches 0 (again*), it will join the civilization that has accumulated the most pressure on it. The civilization can refuse to accept the Free City, in which case the Free City remains free and becomes immune to the loyalty pressure of that civilization.
For more information on how to maintain loyalty, or how to use it against other civilizations: Civilization fandom
*: It's possible for a city's loyalty to reach 0 despite having a positive loyalty per turn value. This can happen when a Spy succeeds in a "Foment Unrest" mission, reducing the city's loyalty to 0. For a city to revolt, it must not only have 0 loyalty, but also a negative loyalty per turn value.