A connecting itinerary is frequently cheaper than the nonstop covering part of the same journey, sometimes on the same aircraft. Fares are set by market rather than by distance flown.
Each city pair is priced separately
An airline treats every origin and destination combination as its own market with its own competitive situation and its own willingness to pay.
Where an airline dominates a nonstop route, it faces little pressure on that fare, so the direct price stays high.
On a connecting itinerary the same airline competes against every other carrier offering a connection, which forces the fare down toward the market clearing level.
Connections fill seats that would fly empty
Hub-and-spoke networks route many passengers through a small number of airports, which allows an airline to serve many city pairs with a limited fleet.
Any seat unsold at departure is lost revenue, so connecting traffic is used to fill capacity that local demand alone would not.
Because that traffic is incremental, the airline can accept a lower fare for it while still improving the economics of the flight.
Nonstop carries a convenience premium
Business travellers value time and reliability and will pay for a nonstop, and they book closer to departure when fares are highest.
Leisure travellers are more flexible, book earlier and will accept an extra stop for a lower price, which is precisely the segmentation airlines want.
Selling both from the same aircraft lets the airline capture two willingness-to-pay levels without cutting the price for everyone.
The saving has real costs attached
Each additional segment adds a chance of misconnection, and a delay on the first leg can consume an entire day.
Total journey time rises substantially, and a long layover in an unpleasant terminal is a genuine cost even though it does not appear in the fare.
Baggage handling introduces another failure point, since bags transfer between aircraft on a schedule as tight as the passenger's.
When the connection is worth taking
On a single ticket the airline carries the obligation to rebook after a misconnection, which is the protection that makes a tight connection reasonable.
Separately booked tickets remove that protection entirely, so a missed connection becomes a new ticket bought at short notice.
A long connection at a hub with good facilities is often a better use of the saving than the tightest legal option, which trades money for risk.