Price discrimination take advantage of differences in demand across consumer groups. Some consumers are less price sensitive. If a firm has some degree of market power (can be well short of being a monopolist), and it can separate one group from the other (e.g., connection v. direct or advance v. walkup), it can and will charge higher prices to the less price sensitive group.
As to the necessity v. convenience issue, I think it's a matter of degrees. Yes, business travelers are more willing to pay for being able to fly last minute than to avoid a connection (and that's why the price premium is much more for flying last minute than for avoiding a connection). But the same underlying principle is at work: an airline sets higher prices for groups with less price sensitivity when it can. Also, while I agree last minute business travel is quite price insensitive, it is not completely price insensitive.