What does the phase discriminator portion of the Costas Receiver do mathematically?
This circuit is an attempt to reconstruct the suppressed carrier of a DSB signal and use it to modulate the signal back to the baseband ie. to perform fake synchronous detection. I wrote fake, because the carrier isn't the original, but a guessed estimate.

Phase detector can be seen as a product mixer and PI-controller. If the VCO happens to get locked to the missing carrier, then the inputs of the phase detector have all the time 90 degrees phase difference. The integrator of the PI controller gets averagely zero input => the integrator doesn't drift =>VCO frequency stays.

Traditional PLL mumbojumbo doesn't say Phase detector is a product mixer+PI controller. They have named the PI controller as "loop filter". But that's not only a naming convention. It allows also finer control methods than PI, altough I have found in my simulation experiments that PI controller works fine.