>>38859105pokemon amie hax.
It got a new name each generation since gen 6, but pretty much it only applies during gameplay that isn't " online competitive, or battle facility".
Gen 6 was the amie
gen 7 was the refresh
Gen 8 and 9 was the camp.
The more affectionate you make your pokemon using these things, they can do things like have the effect of a focus band - living on 1 hp, healing a status effect without the need of an item mid battle, forcing a critical hit, or just outright dodging even a 100% accuracy move.
It really is just hax in the game where it doesn't matter.