The critical chance is always based on the offensive Pokémon vs defensive Pokémon individually; so if your move hits 3 Pokémon, the game calculates 3 separate critical hits, one for each Pokémon hit (same for multiple hits moves like Fury Attack). Also, the critical chance can be changed in various ways:
- by abilities:
- Super Luck increases the critical rate, Togekiss and Unfezant are currently 2 lonely final evolutions that can have this ability
- Merciless which guarantees critical hits on poisoned Pokémon; this is a special ability of Toxapex
- Battle Armor and Shell Armor prevent critical hits against Pokémon with this ability. The Pokémon that has this ability can still land critical hits on the enemy (Drapion can have Battle Armor or Kingler with Shell armor for example)
- by held items:
- increase critical chance: Scopes Lens, Razor Claw, Stick (only for Farfetch'd, also known as Leek on Gen VIII), Lucky Punch (only for Chansey)
- by moves:
- Focus Energy increases the critical chance for the current Pokémon; without any other changes, your critical chance is boosted from 6.25% to 50%
- Lucky Chant prevents all critical hits for 5 turns (and it's still effective even if there is a switch)
Also, there are some moves which have high critical chances, all of them can only target a single Pokémon except Razor Leaf, which is a Grass-type physical move since Gen 1 (base power : 55, accuracy 95%, hits all adjacent enemies in double and triple battles, but not allies); thanks to @Zoma who mentioned it.
You can find more information on Bulbapedia's page on critical hits.
NB : If you have a Kingler with ability Shell Armor poisoned against a Toxapex with Merciless, the Shell Armor takes precedence and no critical hit happens. (here is a screenshot of a simulation done on pokemonshowdown to confirm this):
As you can see, no critical hit was landed.