Ammunition is a resource that is consumed automatically whenever any survivor goes on a mission while having a gun, crossbow, or rocket launcher equipped. Ammunition does not have to be assigned to specific survivors beforehand. Ammunition is not differentiated (in other words, you can't run out of rifle rounds while still having shots for your pistol). If the fortress has zero ammunition remaining, then weapons that require ammunition will not provide any Defense bonus to survivors.
Ammunition can be scavenged, traded, and crafted in a workshop by a survivor with Engineering skill. Creating ammunition in a workshop only consumes the time of the engineer; there are no material requirements to create ammunition. If the Fireworks research has been completed, then 5 ammunition can be consumed in a workshop to create 2 units of fireworks.