Lvl Up & Stats

This game tells you absolutely nothing about how it works. You have to research what all the stats mean and learn how to upgrade weapons etc with no help. Anyway, I've always been curious how gaining stats after leveling up works, especially since there's an option to 'Reset Character Stats'. Is it random? does it depend on your performance? Is it predetermined which stats increase for each level? What are the benefits of resetting?
Resetting helps if your characters gets too many increases in a stat you don't want. So far, I'd say stats increase at random.