Hi, I'd like to help you with your question.
It sounds like she might feel guilty about what she did to you. She had an affair, which causes a lot of guilt. She may have felt that by leaving, she was abandoning you. When you had the surgery, she felt strong guilt and decided to show up to help to make herself feel better.
But she may also still feel some of the attraction she had to you when you were together. Even though she was the one to leave, people who cheat rarely leave because of the marriage issues. Cheating is always caused by self centered behavior. The cheating spouse feels the grass is greener so they try it out. But then they realize that it's not as great as they thought or if they do leave, they see that they bring their problems with them. That is when the spouse left behind becomes attractive again.
In your situation, you may want to be careful your wife is not using you to make herself feel better. And, if she is attracted to you again, be sure she does not use you and then leave again. If you feel it's worth it, put some restrictions on how much she sees you or contacts you. Maintaining control until you know her motivations is a good way to prevent being hurt again. Also, if she starts wanting to come back, insist on therapy so you know the issues that caused her to leave are going to be addressed so they do not happen again.
I hope this helps you,