My M1 macbook pro spends most of it’s life on mains power, and is now 3 years old with a battery capacity of 91%, so is looking on average 3% per-year. I’ve previously had Dell’s and thinkpads, all of which had replacement batteries by this age, so this is something apple seem to have got right.
I think that leaving it off mains power when not in use may actually be worse, since it doesn’t truly go to sleep when idle even with the lid shut, and still does background things. Leave it unplugged for a weekend and I see the charge can have dropped by a fair bit, so would probably cause more battery wear through additional charging.