If the player’s final Pokémon used Selfdestruct, Explosion, Destiny Bond, or Final Gambit, and both players’ final Pokémon faint as a result, the player who used the move loses that game.
If a player’s final Pokémon used Double‐Edge, Volt Tackle, Flare Blitz, Take Down, Submission, Brave Bird, Wood Hammer, Head Smash, Struggle, Head Charge, or Wild Charge, or was holding Life Orb, and both players’ final Pokémon faint as a result, the player who used the move wins that game.
If both players’ final Pokémon faint due to a weather condition, such as Hail or Sandstorm, the player whose Pokémon faints last wins the game. This includes the effects of Perish Song.
If a Pokémon’s Ability (such as Rough Skin, Aftermath, Liquid Ooze, or Iron Barbs) or held item (such as Rocky Helmet) results in each player’s final Pokémon fainting, the player whose Pokémon had the Ability or held item wins the game.
If it is in game you lose if all your Pokemon faint and will be rushed to a Pokemon centre.
Hope I helped :)
No-one has said this so: the speed stat is directly involved.
eg. Two burned chomps on 1 hp, one of them 0 spe ivs and one with 31 spe ivs, the one with 31 spe will actually lose (although I am not saying to use 0 spe chomp that would be stupid).