How does Battery Management System work (at the hardware-interface level) ? And how is idle self-discharging of batteries handled? I came across the following when I was reading up about fully drained batteries in phones:

If the phone is OFF for a month, then it is probable that the battery has gone down to a point that the BMS has shut it down. The BMS won't allow you to charge the battery because, in its own assessment, the battery is dead. Best way to test this case is to have another same phone with a good battery (or just a new battery altogether), detach the cable from that and test on yours.

Referring to the above, do Android phones have their BMS as part of their bootloader or kernel? Or is it a part of the Power IC itself?
Are there any safety mechanisms related to booting up a device with fully drained batteries? If so, why?
(Came across something similar)

I've had difficulties with phones in the past after batteries have fully discharged - eg the Moto G5 had some battery protection &quot;feature&quot; that stopped it starting up if it thought the battery was fully discharged - it was a bit over sensitive so would sometimes assume the phone was fully discharged when it wasn't. Try leaving it on charge for 24 hours or so then holding down the power button for for at least 20 seconds with it still on charge.
Battery Management System is a very broad term that covers battery charging /discharging/monitoring / power IC /responding to critical events like shutting down on low battery level / User Interface actions (increasing CPU speed when user touches screen - touch boost) and many other things.

Your first quote is only instance of management system where the battery voltage has fallen to a very low level, and a protection circuit kicks in and prevents further charging. This protection mechanism is mandatory


To prevent the battery from over-discharging, a control circuit cuts off the current path at about 2.20V/cell.


Booting up from a fully drained battery, is not permitted, since it would only further drain the battery. Booting  consumes a lot of power and doing so on an already drained battery can lead to irreversible damage to the battery. And what's the point of booting up, if the device can't be used thereafter?

There are ways to overcome these problems but it is best left to  qualified technicians to handle it. There are many questions on this site dealing with such situations.
As you would guess from the first  paragraph, this being a complex system, it is dealt at a low level, meaning at a kernel level with proprietary hardware interfaces. Related Where are the battery capacity files located?