Allegedly, for the Mac mouse the reason is so that people can't use it permanently plugged in, because cables are ugly and against "the Apple philosophy".
My cordless beard trimmer doesn’t run when plugged in, so you have to wait for it to charge before using it. When getting ready in the morning, you can’t sit around for an hour waiting for it to charge enough to function.
I mean from an EE perspective it makes some sense, because you save some on circuitry (not like a lot in absolute cost, but your cordless beard trimmer probably doesn't have a lot of margin).
So the real reason is probably just to make it cheaper. (Well maybe not in the Mac case)
Yeah in case of the beard trimmer it's because it uses quite a lot of power so you need a beefy adapter to run it. These often still use NiMH cells and trickle charge with 100mA or so.
For a mouse this is all irrelevant because it uses so little power that it can easily be powered by a regular USB.
Also, many bathrooms don't have sockets anyway. At least not nearby (and cooper is expensive too these days)