When a city accumulates enough Discontent (100 + 10*level) , it gains a Discontent Level. Each level increases city Maintenance and reduces Growth and Science by 5%. It also decreases the opinion of the city's family by 20. When a city loses Discontent , its Discontent Level goes down instead (to a minimum of 0).
Yearly changes to Discontent 
- -1 for having at least one military unit from the city's family within its borders per wall, moat and tower.
- -1 in the capital per type of Luxury produced anywhere in your empire when not all of it is sent as a gift
- -1 for the Colosseum (tier 3 Theater, requires Strong culture) or Heated Baths (tier 3 Bath, requires Legendary culture) improvements
- -1 per Luxury produced by the city if your empire contains the Grand Bazaar wonder (requires Legendary culture)
- +0.5 per missing urban tile; a city ought to have at least 1 urban tile per 2 population (Citizens + Specialists)
- +4 if the city has lost any amount of HP (caused by enemy attacks, fixable with the Repairs project)
One-time changes to Discontent 
- -20/-40/-60/-80 respectively for the repeatable projects Festival I/Festival II/Festival III/Festival IV (requires Weak/Developing/Strong/Legendary culture)
- +??? for hurrying production, depending on the amount hurried [NEED EXACT VALUES], if you don't have the Monetary Reform law
- Some event options directly increase or decrease Discontent Level