Sigh.
The strength of the city is the strongest unit you've ever built (not had!)* minus 10. Capital gives +3, districts give +2 each. Hills' bonus won't ever show up, but is active when attacking the city - it's the same as with units fighting.
Garrisoning a unit will increase the strength of the city to the strength of the unit, if higher. This, garrisoning your strongest unit is +10.
Walls shoot with the strength of your strongest ranged units from both the archers and the artillery lines.
* - basically this screws Atzecs in the beginning