Bi doesn't even necessarily mean two genders. Yes, I know, but the word literally means two... But people have been using it for "two or more" genders for decades now. Also, some people use it to mean two sexes rather than two genders so that can be many more genders. Bi also usually doesn't express a preference as it is used as "both" rather than "just two".
Originally, if you were attracted to every gender that would be called bi. As we figured out there are many more genders some people decided bisexual sounded like you don't acknowledge all the other genders so they came up with omnisexual and pansexual which originally meant the same thing. When people realized they had two different words for the same thing (and pansexual was slightly more widespread in its use) they decided to change the meaning of omnisexual slightly to something like "I'm attracted to anyone but more often than not it will be x". And pansexual got rewritten slightly as well. Usually, it is now associated with being "genderblind" which means instead of being attracted to any person's gender you're just attracted to the person and simply don't care about their gender.