How exactly would surgery help/fix a fractured kneecap that required it and what does the surgeon actually do?

Depends. If your orthopedic surgeon decides it would be best to fix the fracture, he or she will also decide the best way to fix it. Sometimes pins or screws are used. Sometimes wires. Sometimes the patella is just removed.