Managing you batteries is important, nonetheless in your electric vehicles which rely solely on voltage and currents. To make everything safe, the bms circuitry productors have made a system to constatly monitor the isolation resistance of high voltage bus to the chassis ground.
To do this the TIDA 01513 may detect a leakage and instantly disconnect the power relays and discharge the high-voltage capacitors.
Links
https://www.ti.com/tool/TIDA-01537