So I presume it uses its thrusters to impart a very small spin on one axis, and then on an orthogonal axis.
A mechanism records the signal strength as it sweeps all angles, and once the optimum direction is determined, the thrusters are fired in just the right way to counteract the spin and bring the craft to a halt at the optimum orientation.
Given this was programmed decades ago - the electromechanical system that does all this jugglery and runs reliably for so long would be a great case study for systems design.
Even the programming that ensures that this routine is triggered without fail every few months must also have gone through intense reliability testing.