The first cities developed in the fourth millennium BC as farmers gathered together for protection. As farming improved, some citizens began to specialize in basket making, pottery, and metal working while others turned to the study of early science, becoming the priests of the culture. Through trade, cities exchanged and synthesized ideas and culture.