Interestingly, low-fare airlines have tried working around the problem by setting prices super low, such that they lose money on each flight by default, but making it up in auxiliary services - either selling addons that cost them nothing on margin to implement (priority boarding, early checkin, seat selection), upselling external high-margin services (car rental, hotel bookings, airport transfer services, insurance, phone cards) or directly extracting money from customers (obtrusive advertising, in-flight sales pitches, extremely punitive charges for baggage/airport checkin/over-weight fees/not following obscure rules). This seems more sustainable than the traditional approach of customer price segmentation if price transparency increases over time.
That example is pretty simple. If you consider a non stop flight as a different product than one with layover, non stop has less competition, people who don't mind a layover are more price sensitive and if there's a layover the airline will compete with all the other airlines trying to fill their hubs.
In general, flight pricing seems rather opaque; I'm always confused by flights from city A to city B that are more expensive than flights from city A to city C with a layover in city B. I'm all for more transparency of the air travel market.