What is %R when clicking on REF**

REF** is the primary reference designator, it is substituted by the reference designator from the schematic.

%R is substituted by the value of REF**.

REF** can be used only once in a footprint. %R can be used many times.

In the future in v6, or now in the development version 5.99, you can use ${REFERENCE}. See New string replacement options for kicad assets.