Finding out the cause of painful snapping along the lateral (outside edge) of the knee can be very challenging. It's actually a fairly common problem with many possible causes.
No matter what the cause, conservative (nonoperative) care is still always recommended first. So even if they were able to identify the problem, you would have still been advised to try physical therapy first. Most of the time, the symptoms resolve and surgery isn't needed.
But persistent symptoms despite conservative management can point to the need for surgery. You were one of the few who needed a mechanical relignment of the muscle/tendon unit. The preoperative rehab program may have actually helped prepare you for a faster recovery after surgery. Improving flexibility, strength, and stability before surgery often yields more positive results afterwards.