The TL431 could be thought of as a high gain transistor with a (something like) 1.8V zener in series with the base.
When the reference pin is at or above 2.5V, the device switches on; less than 2.5V and it's off. It will try and short out the supply to hold the ref pin at 2.5V.
As shown in the thumbnail (I'm not watching the video) the relay will activate when the input voltage reaches a certain threshold.
That could disconnect the battery via the relay contact, at which point the charger input voltage may increase further, holding the reference higher still and locking the relay on, until power is removed.
However - it's a really bad idea for charging a battery.
For a normal 12V lead-acid, the charge voltage should be set to 14.8V for cyclic charge/discharge use, with a current limit so the charging power supply is not overloaded when a flat battery is connected.
Charging power should only be disconnected when the charge current drops down a fairly low level - which happens long after full voltage is reached. Alternatively, the voltage can be reduced to 13.8 and left at that on float charge.
For other battery types the principle is generally the same, though with different voltages etc:
Bulk charge at constant current, then the charge completes at constant voltage, with current reducing as the battery nears full capacity, then cut off totally when the current drops to a low threshold.
(13.8V is float charge voltage for a 12V lead acid, that can be connected permanently - no cut-off needed).
See the "Battery University" info on charging batteries of whatever type you are using.