Charge 12 V, 1.3 Ah lead acid battery via 12 V, 5 watt solar panel
Let's assume 

Solar panel generates a voltage Vs, 

Op-amp U4:A has a gain of A, 

Then,

Equation for op-amp U4:A is given by:

$$V_{out} = A(V_{+} - V_{-})$$
$$V_{out} = A\bigg(V_{s}\bigg(\dfrac{R10}{R10+R7}\bigg)+V_{chrg+}\bigg(\dfrac{R15}{R15+R14}\bigg)\bigg)$$

$$V_{out} = A(V_{s}(0.909) - V_{chrg+}(0.909))$$
$$V_{out} = A(0.909)(V_{s} - V_{chrg+})$$

Hence from the above equation one can see when Vs > Vchrg+ then Vout is high (Vcc) and when Vchrg+ &lt; Vs then Vout is low (GND).

Also Q3 is a PMOS so the ON condition for PMOS is

$$V_{sd} &gt; V_{sg} – |V_{t}| $$

i.e.

$$(V_{s}-V_{chrg+}) &gt; (V_{s} - V_{out}) – |V_{t}| $$

(Vt's value can be determined from the datasheet of PMOS Q3)

Therefore if you solve it further, simply put, the charging will start (i.e. Q3 will turn ON) only when the solar panel voltage is more than the battery's voltage by some threshold

This is because if let say Q3 turns ON and battery's voltage is less than solar panel's generated voltage, the current will flow from battery to the solar panel which is undesirable. However diode D52 is there to prevent that (to provide extra protection, in case PMOS is shorted due to over current, then with no diode in place the current will flow from battery to solar panel)