Alice and Bob doing an atomic swap breakdown

Hi,

in this usecase

from plutus-doc

What’s the difference between Cardano and the Ledger ?
Why is the application only talking once with the Ledger and once with Cardano ?

I would expect the Ledger to be the database and Cardano to be the consensus mechanism but their respective icons suggest the opposite.