Your MacBook does not know better than you. Apple's macOS has an infuriating habit of automatically changing the computer's screen brightness level, seemingly at random. No, it's not all in your head.
Use the following suggestions if your Windows laptop screen dims when it is unplugged. Check the battery saver settings Disable Adaptive Brightness Disable the Sensor Monitoring Service Change AMD ...