How does a Resolver-to-digital converter work?
The detector is a phase detector. It tells you on the diagram that its output is Ksin(theta-phi), the sine of the angle error, which for small errors is more or less the error itself.

This is used to complete the phase locked loop, which drives the angle estimate to be equal to the input angle. The integrator is used so that any small error does not persist, but builds up until it gets corrected. It effectively gives it infinite gain at DC.