How was that sir? Do you know why is it like that?
Yes. Apple implemented their "battery health management" algorithms so that Mac users do not have to concern themselves with the need to subject them to the occasional usage they require to derive the greatest possible useful life. That characteristic is typical of the lithium ion batteries used in nearly all portable electronic equipment these days.
In other words, if you don't use the battery, the Mac will use it anyway.
By way of background information, Apple found themselves having to defend the manner in which iPhones with aging batteries behaved—iOS reduced their performance to better cope with tired old batteries that might not be able to provide peak power when energy-demanding apps required it.
Like iPhones, a Mac's power requirements are discontinuous and unpredictable. They spend most of their time idle while consuming very little power, but when a process suddenly requires a lot of power from an old battery, the iPhone might just spontaneously shut down due to that battery's inability to provide it. Obviously that wouldn't be acceptable. So when a battery becomes old and decrepit as they all eventually do, the iPhone would reduce its performance accordingly. Nevertheless, some consumers thought this was some kind of conspiracy on Apple's part, forcing them to buy new iPhones. They were wrong of course, but they threatened litigation. Rather than subject themselves to an ugly protracted battle involving arcane technical details most people don't appreciate, Apple settled for monetary damages of half a billion dollars. That's what happens when you try to do the right thing.
iPhone users are not really interested in understanding arcane details like that. No one needs to concern themselves with such minutia. They just want their stuff to work; a fundamental human interface concept that lies at the heart of everything Apple does.
Since their batteries use identical technology, Apple has now implemented that feature in Macs. That explains the behavior you describe.