The alliance treasury contains the resources of your alliance. These resources can be used to recruited alliance units, do researches or buy upgrades in the kingdom center. You can add resources to the treasury by donating or by collecting taxes.
 
Taxes are collected from inhabitants of a kingdom you control. You generate more taxes the more resources the inhabitants of the kingdom produce. Inhabitants do not lose resources when you collect taxes, they are just additonal resources for the alliance.