Initially as ling as the battery voltage and the over all voltage from the 48V supply remains below the full charge threshold level of the battery, the output of the opamp stays high and the mosfet us kept switched ON. This allows the voltage to the battery for charging, until the above explained threshold is reached which automatically inhibits the battery from further charging.
The mosfet can be selected as per the AH rating of the battery.