Experience, also known by the abbreviations "XP" or "EXP", is a game concept in Civilization IV, Civilization V, and Civilization VI. Military units gain experience by surviving combat and defeating enemy units, and when they earn enough experience, they can receive promotions. Some of the buildings that can be built in cities give bonus experience (either a flat sum or a percentage bonus) to the units produced there.
In Civilization IV, your units will receive promotions if your leader has the Aggressive or Protective trait. There are also some civics, such as Theocracy, that give you free experience for every unit.