They are all trying to make the most money.
A, You could charge more, hope to only part fill the aircraft but get more revenue than filling it with low revenue passengers. To do this you need to keep a reputation for high quality service so people don't mind paying more. But it can't be too good or the same people won't buy business class.
B, You could charge less but then you need to be sure that you will totally fill the aircraft. Since a full high seat density aircraft isn't pleasant you know your customers won't be as happy so you rely on either non-repeat or occasional travelers or those who will only pay the lowest fare. But the conditions might mean you have a better chance of selling upgrade seats.
Then there is the question of how to adjust prices. If you are a 'B' and leave a seat empty you are losing money, it would be better if you sold the seat for even 10% of the list price. But if you are known to do this people will wait until the last minute. Alternately if you are a type 'A' airline it might be better to have an emptier plane with more space. On the other-other hand if you are an 'A" then a sale might allow people who wouldn't normally fly with you to get a taste of the good life.
Interestingly these same things were worked out 150years ago by the first railways, who would make the 3rd class coaches deliberately bad to persuade people into 2nd class. Or pay chimmney sweeps to travel 2nd class to force office workers (who needed to keep clean) to travel 1st class.