Well it’s all in the wording.
Pansexual is an attraction to all genders.
Bisexual is an attraction to two or more genders or your same gender and others.
As you’ve probably noticed (in by the fact that your asking this question), these definitions are very similar and have a lot of overlap. Sometimes people use them to mean the same thing, sometimes they’re used to mean different things.
Sometimes bisexual is used to mean attraction to men and women and excludes non-binary genders. This is not how the bisexual community uses it though, and that definition is biphobic for that reason.
Sometimes bisexual is used to mean attraction to some genders, but not all genders.
But sometimes, people identify with bisexual and are attracted to all genders.
People might choose pansexual to identify with if they feel like bisexual is a little to rigid and structured. Some people might choose pansexual if they want to make it so that their attraction to all genders cannot be ignored or misunderstood by other definitions of bisexuality. Some people might choose it if they like the way it sounds better. Some might choose it if they want to draw attention to non-binary genders - I know a lot of non-binary people who identify with pansexual over bisexual more because they want the language surrounding their sexuality to point very clearly to non-binary people. Some might choose it just because they feel more comfortable with it, or because they feel uncomfortable with bisexual.
On the flip side, some might choose bisexual because it’s more widely known and accepted. Some might choose it because they identify with one of these other definitions. Some might choose it because they want to draw attention to the fact that many times bisexual does mean attraction to all genders. Some might choose it because they take comfort in the familiarity of the word. Some might choose it because they like the open ended language of “two or more” or “same and other” and they feel like “all” feels too concrete. Some people might choose it because they feel more comfortable with it or because they feel uncomfortable with pansexual.
Also, many people identify with both of these words at the same time.
At the end of the day, the difference is subjective. There are many reasons people choose one over the other and their definitions are very similar.
I hope that answered your question!