It is not that the city itself is a resource. It is just that the name of the city was used for the name of the resource for simplicity's sake is all. A resource can be named anything. All that matters is the region it is assigned to in Descr_Regions. For example, the hidden resource "sparta" is assigned to the regions of Laconia (which has the city of Sparta) and Sicilia_Graecus (Syracuse).

If a unit requires a resource (hidden or not) to recruit it, then you can only recruit the unit from a region that possesses the resource. Following the example above, the Greek Cities can only recruit Spartan Hoplites in the regions of Laconia and Sicilia_Graecus (Sparta and Syracuse), because they require the hidden resource of "sparta", and those are the only two regions with it.