Mana is used in many games’ Magic systems to pay for the cost of casting spells.
The players finite pool of magic limits the player in the speed, number and power of the spells he can cast. Given how relatively strong magic attacks often are and become, mana is a convenient tool to balance magic for combat.
Other mechanisms exist, e.g. more powerful spells could have longer cooldowns before they can be used again. By instead using mana as a universal magic currency, you offer the player a free trade of any combination of his spells, e.g. 3 minor heals against one major fireball.
Typically, your mana grows back slowly, or quickly by drinking mana potions. Mana gain potions often have usage restrictions, e.g. only once per combat or outside combat, to avoid the player effectively sidestepping mana limits by hoarding and chain-chugging 50 mana potions in a single fight.