Vitality surges are used to heal troops after getting beaten up in battle. Before their introduction, if you wanted to do the same thing, you would've needed to spend diamonds. Now, you got a new button below it.
View attachment 13448
Clicking the button that corresponds to which squad you want to revive brings up a window asking
which vitality surge spell you want to use.
View attachment 13449
As for the "when", you'd do it when you really need those troops alive rather than dead, such as in between waves in a multi-wave battle as is the case in most of the possible encounters in Spire. And for that unasked question, that feature also works on completely dead stacks, so long as you do the revival right then and there.