Energy is a long term resource used for the activation of active skills, maintenance of passive skills and dodging. Whenever a skill is activated or a character dodges, a percentage of the total energy (as opposed to an absolute cost) is expended; walking, running and jumping do not require any energy at all. Energy is represented by the energy bar, a blue indicator above the right side of the skill bar.
A notable feature of energy is that defensive skills require considerably more energy than offensive skills. Energy was thus implemented both as a long term resource and as a way for players to measure the difficulty of an encounter, replacing the somewhat binary outcomes of the original Guild Wars, in which a player simply either won or lost.
Energy recharges slowly both in-combat and out-of combat. Players may supplement the natural energy recharge using energy potions, which are available through all characters as a potion button attached to their energy bar. Drinking a potion replenishes a significant amount of enery and puts this button into recharge, for a short time out of combat but for a longer time when in combat. Potions could then be used as a way to measure the difficulty of a fight, as harder encounters would require more energy potions.
In PvE, there are multiple types of energy potions, which replenish different amounts of energy. Potions may be bought from merchants or found as drops from enemies, and generally are not very expensive. In PvP, all characters are given access to the same amount of potions on each fight, and this amount resets upon character death; ArenaNet considered adding potions in PvP maps, creating a sort of re-supply mechanic.
Behind the scenes
ArenaNet mentioned energy potions were used, in PvE and WvW, as a long term attrition mechanic. Potions worked as a gold sink, with the goal of preventing inflation, and they were also used to inform players when they were playing inefficiently or when they were in an area that was too hard for their character or skill level, as players would take not only a hit to their cash to replace those potions but would also eventually have to leave the area to go replenish them. In PvP, potions provided a secondary objective mechanic, as a player would need to be aware of where potion caches were so they knew where to retreat to when wishing to replenish their supply of potions.
On August 15th of 2011, Jon Peters announced that skills no longer cost energy, and so energy potions were removed from the game. Energy became a resource used only for dodgindg, and now just regenerates over time . A new system would replace the role of potions in PvE, but it was still in development at the time. In PvP, potions' role as a secondary objective was replaced by secondary mechanics tied to how specific maps plays, such as the trebuchet in the Battle of Kyhlo map.