I think in the GBA games, the RNG seed is set by how much you move the cursor. So if you're doing a lot of scrolling around and looking at different units' stats, then the RNGs are going to be all over the place.
So if you're playing on an emulator and get a result in battle you don't like, you can just reload your save state and scroll around for a bit until you get the result you want
Newer games probably have a more refined number generator code, and use things like the system clock for the seed.