I have not gotten to play either Scarlet or Violet, so I am not sure about the mechanic. I really would appreciate someone giving me advice on this before I play.
In Pokémon Scarlet and Violet, Pokémon holding a Mirror Herb may learn moves that they can normally learn only by breeding from another member of the trainer's party while in a picnic and they possess at least one open move slot. This bypasses the need for breeding for a specific move entirely.
Source
My experience is that it only works on moves that are learned exclusively as egg moves, and not, for example, a TM or a level up move or a move learnable from a previous generation.