there *is* logic, and it is much more complicated than that.
The chance of a city flip has to do with:
1) Number of tiles in the city radius (the fat X) that are in another civ's cultural boundary
2) Number of foreign citizens in the city
3) Number of resisting foreign citizens
4) Comparative culture of the two civilizations
5) Size of the garrison
6) Whether the city is in disorder (I think)
7) Distance to the city from each civ's capitol
8) Amount of culture of each civ in the city.
Points 2, 3, and 8 are generally only applicable to a city you have captured from your enemy.