You spend iron, wood and clay when ordering construction, research and troop training. Population capacity works differently: it remains occupied while needed by buildings, your own troops or queued orders.
The iron mine produces iron, the sawmill produces wood and the clay quarry produces clay. You can also obtain resources through trade or shipments. The stock of each resource cannot exceed the current warehouse capacity. This limit also applies to returning loot and cancelled order refunds: any amount that does not fit is lost. Reducing the warehouse level also removes stock above the new capacity. Uncollected guide rewards are stored separately and can be collected later.