Forced to use Mac for work, the previous Macbook Pro would lose charge _while plugged in_! The battery goes empty, it shuts off and I wait for it to recharge while off.
They recently changed mine to an M1. Battery is much better than the previous generation and could be good, so long as you're not using it for anything. As soon as the IDE/Zoom/Docker/what have you spins up, it loses charge. It is slower at loses charge while plugged in, but so long as you are not using it except for note taking, I would not trust away from a power source.
If I don't have a power source nearby, I turn everything off and switch my dev workflow to Sublime to prolong the battery.
I don't have to suffer any of these shenanigans under Linux. Granted, I have a Thinkpad, which has great Linux support, so that definitely helps.