Anti-Aircraft units are the mobile variant of the stationary Air Defenses, which are an upgrade of the earlier Lookouts and Observation Posts. While the latter ones are more effective in defending cities, outposts and wonders, Anti-Aircraft units are supposed to accompany armies and protect them from enemy air raids. Depending on enemy air power, try to bring at least 3-5 AA units with an attacking army, otherwise you might lose important units such as Generals, Supply Wagons and Artillery Weapons to enemy air raids.
Anti-Aircraft units' production cost increases progressively with every Factory unit on the field or currently in production. The default increase is 20 Food and 20 Wealth for the second unit created, increasing further with every new unit until the cost cap is reached, which for military units is +125% of their original base value.