It's damage dealt/hp taken away from enemy, and critical hits count too.
The more damage your dealing the more the bar builds. So tap tap tap away.
More so I read that Pokemon Stamina is the most interesting stat of all. Stamina is required to perform your secondary special move and is represented in battle by a blue bar under your Pokemon’s health bar that slowly fills during battle. A higher Stamina stat means that Pokemon will be able to power up and fire off the slower but more powerful special moves more quickly during and throughout battle, which makes it a pretty significant statistic.