Just after an opponent has a stat increase, the holder consumes the Mirror Herb and gets the same stat increase. If multiple stats of the opponent are increased at once (for instance by using Dragon Dance), all the stat increases are copied.
Outside of battle
In Pokémon Scarlet and Violet, if the player has a picnic with one Pokémon that holds a Mirror Herb and has an empty move slot, and another Pokémon that knows a move the first Pokémon can learn as an Egg Move, after the picnic the first Pokémon will learn that Egg Move, even if there is no matching Egg Group or if both Pokémon are of the same gender. This does not consume the Mirror Herb.