From Adrian Goldsworthy's biography of Caesar:
Even allowing for hostile sources, Pompey had not done well at Pharsalus and had little impact on the course of the battle after it had begun. Soon after the cavalry attack failed, he returned to camp. A little later, as he saw the signs of collapse, he took off his general’s insignia and fled.
Obviously the battle was going poorly for him, but that doesn't sound like behavior befitting a commander as distinguished as Pompey. It gives me the impression that Pompey's effort was half-hearted. Why was he so quick to give up?
This is a hard question to answer especially following the rules of the subreddit because Pompey didn't leave any writing that survives (and as far as I know he didn't write anything), so I don't think there can be any secure means of gaining access to his thoughts.
The first thing to mention is Pompey expected to live. There were still armies loyal to Pompey in Africa and Spain, and in fact Caesar almost died at Munda in Spain, so the war was by no means over. Pompey's son, Sextus, had control of Sicily well into the 30s, and Augustus eventually had to take him out. When Pompey got off the boat in Alexandria I bet he was as shocked as anyone else to find his head cut off.
TL:DR there were three more years of war and Pompey fleeing could have been a strategic retreat. There were also other politicians around whom opposition to Caesar could concentrate and they came damn close to winning. Who knows? If Pompey wasn't assassinated, maybe he could have won?