Priority
In a normal battle, the priority of a move is determined by the speed statistic of the Pokémon battling. However, there are moves with their own set priority.
Priority based moves are moves that will go before other moves, such as Quick Attack and ExtremeSpeed, or after other moves such as Counter and Metal Burst. Moves that last a whole turn, such as Protect or Magic Coat will have much higher priority to ensure that the move is used at the start of the turn. When the priority of two moves is equal, such as both Aqua Jet and Quick Attack being used, the Pokémon with the higher speed will act first.
The priority for similar moves may be different, such as ExtremeSpeed and Quick Attack. If Quick Attack and ExtremeSpeed are used by two different Pokémon, ExtremeSpeed will go first as it has a higher priority than Quick Attack.