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.
It is billions km away.., is the earth that noisy compare to solar wind and cosmic rays?
The carrier signal from Earth is also powerful on a particular frequency and polarization. While there's definitely noise at the receiver it's looking for a very specific signal so can filter out everything it's not expecting. We do the same thing on the Earth side, filtering out noise to recover the very weak signal received from Voyager.