Citizens have a nationality distinct from that of the state they inhabit. When a city grows due to food surplus, new citizens take the nationality of the city's current owner, but when a city is conquered or otherwise transferred, its citizens retain their original nationality, as do any immigrants. Units founding or contributing citizens to a city can also bring their own nationality.
Citizens of another nationality will work in your cities just the same as your own, and behave the same in most respects, but they may become unhappy when you are at war with their associated state; their presence makes it cheaper for their state's agents to incite revolt in your cities; and if migration is enabled, they have an increased tendency to migrate to their state's cities. Over time, citizens may be assimilated into their home city, depending on ruleset settings.
Some rulesets do not have nationality; in this case, citizens always consider their nationality to be that of their home city. If nationality is enabled, you can see the cultural makeup of your cities and any consequent effects on happiness in the City dialog, on the Happiness tab.