Like Advanced Wars, after every mission in the campaign you are given a letter grade from E to S. Advanced Wars has a relatively simple formula for calculating points and rank, which can be cheesed (see below). The number of units defeated, lost, and turns taken is also displayed, so presumably those are the factors. According to Wargroove's campaign editor, there is a hidden par turn count for each map, like Advanced Wars. How exactly does the other two factor affect the rank calculated by the game?
In Advanced Wars, Speed decreases for every day over the hidden par count, Power is given by the max number of units destroyed in a single turn as a percentage of the total number of units created by the enemy, and Technique requires you to not lose more than 20% of your total units. This means these numbers can be cheesed, for example by infantry HQ rush or by creating infantry over the last few turns to pad out units lost.