Most of the heroes in the game require 100% energy to activate their first and the most powerful ability. There are two exceptions to this rule: Celeste (she only needs 50% of energy) and Astrid with Lucas (they have a completely different resource system, called Rage). Heroes accumulate energy in the following scenarios:
Energy for using abilities
A hero receives 10% for using any ability besides the first one and passive ones. Basic attack also counts as an ability and grants your hero 10% of energy bar.
In this example we see Thea attacking Aurora, and she gains 10% of energy for using her basic attack:
Please note, however, that this rule also applies even if the target dodges the attack. On the picture below you can see Thea still getting 10% of energy to launching a basic attack on Aurora:
Next scenario: Thea uses her second ability, called 'Healing Beam'. She also gains 10% energy bar for this cast:
Energy gain for losing health
Heroes gain 1% energy for every percent of the maximum health points they've lost. For instance, your hero has 10 000 Health total and receives 1000 damage. In this case, he will receive 10% of energy. If he has 20 000 health total and receives 1000 damage — he will only gain 5% energy bar.
In the example below Ishmael with nearly 5 000 attack hits Chabba with approximately 10 000 health. By dealing 5 000 damage, he brings Chabba down to 50% health. So, as a result, Chabba gains 50% energy bar — 1% of energy for every percent of maximum health he has lost.
And another example. This time Chabba has 20 000 health total, and by taking 5 000 damage he loses 1/4 of his maximum health. In this situation he will get 25% energy bar, like in the picture below:
Energy for killing an enemy
For killing an opponent your hero gains 30% energy instantly.
On the picture below maxed out Ishmael attacks Lilith and Chabba, and delivers a killing blow with 1 hit. In this case, he will gain 10% of energy for using a basic attack and an additional 30% of energy for the kill. So every attack gives him 40% of energy, up to a total of 80% energy at the end of the fight.
Please note, however, that Titans' energy generation is slightly different and has different percentages. You can find out more in this article: Tournament of the Elements and Titans.