Within every market airlines publish not just one, but many fares. For example, British Airways offers more than 280 fares between Boston and London. Some airlines publish as many as 1000 fares in international markets, and there are various “macro” systems in the industry that can double or triple that number.
Each fare has a different price and a different fare basis code. A reasonable question is why the airlines publish so many fares, if the traveler is free to choose the cheapest. The answer is that each fare has its own rules restricting use, so that in any particular circumstances only a small subset of the fares may be usable.