(Edit: Cross post with Verge)
The city can be gifted to a neighbouring empire or independence due to its proximity. I don't have the technical take, but I have assumed its a combination of distance (incl. inter-continental), foreign population and/or cultural pressure.