If you build a city building next to a resource that you've harvested, said resource usually gets incorporated inside the city walls (unless said resource belongs to another city). Incorporating resources inside city walls prevents said resources from being razing targets by maurauding monsters, etc.. Unless the monsters attack and raze the city itself, of course!
Most of my cities look like 'x's and such, because my builds are always placed towards the direction of the nearest resources, so that I may incorporate/protect said resources within the city itself as soon as possible.