mirror don't flip up and down nor right or left, it flips front and back. because that is how sumetry works (where the mirror is the symetry plane).
if you point right, your reflection will also point your right. same for left, up and down. but if you point forward, it will point back toward you (behind you, that is)
It's your brain that is tricked by your reflection and takes it for a real person, so when you move your left arm, your brain understands it as if your reflection moved its right arm.
sometimes it's also bugs caused by optimizations.