Peppermint oil masks the pheromone trails that mice leave behind, and which other mice use to find their way around. Naturally they don’t like this, and prefer to spend their time in areas where they can easily navigate.
The strong peppermint oil scent also irritates the nasal cavity of the mouse. Mice have an extremely acute sense of smell. The menthol in the peppermint oil which we find refreshing is at very strong concentrations quite irritating to the mouse. So they will avoid any area in which the scent is too strong. It also masks the smell of food which can attract mice.