Some people have more than one passport (multiple citizenship) and could use a different one to enter different countries because of visas. The name could be partly different on those passports. But yes, they probably know the passport they'll use since the time they buy the ticket.