Building of the Ancient era
Quick - Regular - Epic - Marathon
+15 experience for all units built in this city
This excerpt is from the Civ 5 guide:Edit
Barracks are the first way to improve military units in a city through the use of buildings. Eventually you can chain together Barracks, Armories, and a Military Academy. Though expensive and time consuming to put together, this creates a city that produces veteran units right off the bat, cutting casualties in the field considerably.
Peaceful or defensive empires don't need Barracks in every city. Building these is time better spent on cultural endeavors. For more martial people, it's wise to have these in every productive city so that a force can be marshaled in far less time.
A universal system of Barracks is needed if you want to create a Heroic Epic; this is a National Wonder that gives +15% in combat to any troops constructed in the Heroic Epic's city. That's a massive benefit. If you get this system of Barracks created early in the game you can build this National Wonder without needing a ton more Barracks. Otherwise, add one per city and your Heroic Epic in a place with high Production. Make that your primary military city, and make sure to give it all possible upgrades through the Armory and Military Academy.
+15 XP for all Units.
Barracks provide experience for military units constructed in the city. This experience can be used to give the units Promotions, making them more effective in battle.
Barracks are military buildings that house a country's professional soldiers. In addition to providing food and shelter for the soldiers, they provide training and medical facilities, as well as military jails, vehicle maintenance, and so forth.
Barracks are important to a civilization's happiness and well-being. They promote cohesion among the ranks, improving the soldiers' chances of success in combat, and they control direct contact between civilians and soldiers, limiting the friction that is almost universally caused when the two groups intermingle overmuch.
end of excerpt