Conor Lamb comes from a very old-school, VERY well-connected Pittsburgh Democrat family. He likely could have got elected just on the last name Lamb (which is almost like Casey).
He had to work very hard to get elected (narrowly) in Tim Murphy's old district; less so when he moved to the Keith Rofthus district in a wave election where GOP voters turned out like it was an off-year election whereas Dem voters turned out like it was a presidential election (2018).