For the two who have leveled up this way in Critical Role, it was kind of like a Second Wind situation (spoilers ahead for episode 10):
Thimble was squaring off against the “boss” enemy, the knight of Seremai, who was mostly unharmed while Laura was on very low HP. Sam leveled up on his turn, mainly to gain the extra sorcery point he needed to use Hightened Spell and give the knight disadvantage on his save, which Sam framed as Wick trying to prove himself to Thimble. Of course, the knight succeeded his save even with the disadvantage, so it ended up a little anticlimactic. Then on Laura’s turn, she decided to take her level up as well. Even after gaining that extra HP she was still bloodied, but she attacked, presumably to activate her Swashbuckler ability to retreat without taking an opportunity attack, and rolled a critical hit. So, she also used Brennan's homebrew Desperate Measures mechanic, giving herself two pre-failed death saves in order to add extra dice of damage to the hit, which were then doubled by the crit, and ended up bloodying the knight in a single attack, and then Dashing away.
So, I kind of saw those level ups as adrenaline rush moments. Much as people occasionally perform incredible feats of strength and endurance in desperate moments, the PCs were backed into a corner by a superior foe, and that survival instinct kicked in, allowing them to push past their limits. And then, I don’t know, I guess via anime logic, after pushing past those limits, it’s no longer a limit for them, they’ve just unlocked a new extent of their capabilities they hadn’t realized before?