The logic is simple, you book your ticket with an airline and that airline is liable for flight disruptions. The legal logic is not quite that simple.
Regulation (EC) 261/2004 (European Passenger Protection Regulation) uses the concept
of the 'operating carrier'. That means the airline that actually undertook to transport the
passenger faces the liability and obligations in case of disruptions (delay, cancellation and
denied boarding). But those knowing a little about how the airline industry works have also
heard of 'wet lease', 'dry' or 'code sharing'.