Runtime equates to mAh numbers.
Runtime of 2S 4000mAh is lower than 2S 5400mAh.
The "h" is "hour" - think time. MilliAmp Hour. Amps over time is runtime.
Now, 3S is higher voltage - if you went from 2S 3800 to 3S 5400 - you get more runtime and some insane speed vs. the 2S. You may get less runtime - because you'll run faster and may break A-arms, easier
Also, some ESCs will not allow higher voltage of 3S vs. 2S. More likely, you should stick with 2S and go as high as you can afford with the mAh numbers.