What is the use of V ref pin in a differential amplifier?
It is useful to set output DC voltage.

\$V_{REF1} and V_{REF2} \$ are DC voltage and at the input there are two resistors:



by doing some calculations:
\$V_{ref out}=\frac{V_{REF1}+V_{REF2}}{2} \$

In the first image, \$ V_{ref1}=V_{ref2}=5 V\$ that means \$V_{ref out}=5 V \$ and this voltage will be amplified by the OpAmp and the output DC voltage will be 4.8V.

In the second image, , \$ V_{ref1}=V_{ref2}=0 V\$ that means \$V_{ref out}=0 V \$ and this voltage will be amplified by the OpAmp and the output DC voltage will be 0.05 V(it is not 0 volt because of offset, typical of the op amp).

For example, if you connect \$V_{ref1}\$ to \$ V_+\$ and \$V_{ref2}\$ to GND, you get \$V_{ref out}=2.5 V \$ without any external voltage.