It's not entirely off chain. It's hedged in that a transaction is created sending X BTC between us, we repeatedly update that transaction off chain every time we move small amounts of money between eachother, then after Y days we submit the final transaction to the blockchain to resolve the total amounts.
The idea being if one of us starts to be uncooperative, the other can just submit the transaction at its latest state so that we don't lose anything except that last update that we disagreed upon.
But as you said, coffee shop needs some path to you to make that feasible. So then you get BTCVisa (c) or whatever, which is a channel provider that has built a network of channels open with lots of vendors. If you open a channel with them then you get to benefit from getting to use the wallet you already have. There is cross-channel routing of course so maybe that doesn't happen but it seems like a natural result.
LN is neat in concept, but I'm not sure I really see the point compared to Bitcoin cash or the like that just say scale on chain. I guess we'll see.
So, most likely the coffee shop has just one or a few channels open to popular exchanges or dedicated LN services. You open a channel either directly or indirectly to the same exchange / service.
You and that party can now transact freely between each other with no fees, but if that other party is a gateway, it can route payments through it and through other gateways too, and each of them charge fees for routing.
Once any of the parties decide to close the channel, is when a new onchain transaction is created with the last balances state.
While the LN channel is open, only the parties involved know the current state of the balance.
EDIT: ah, I think "nicpottier" explains a little more, below. about having an account on LN requires a certain amount of a deposit (like a debit account).
To know how they update trustlessly you should read my other comment https://news.ycombinator.com/item?id=27451184
LN eliminates the need of escrow completely by using bitcoin's script (smart contracts) in clever ways and a bit of cryptography
I'm out of the loop, I didn't realize bitcoin had contracts yet. Cool.
Taproot is also a rad upgrade that is going to improve bitcoin's layer one scripting in some interesting ways, https://bitcoinmagazine.com/technical/taproot-coming-what-it...
I haven't looked into this much, but there are projects like Rootstock, https://www.rsk.co/, that essentially recreate all of Ethereum's functionality as a bitcoin sidechain.
But you can express things like "if X and Y cooperate they can spend this transaction or Y can spend after 1000 blocks or X can spend if it reveals the preimage of this hash ____"
These logics are what LN uses in its update-transactions
Every transaction in a LN channel is not a simple transaction, it's a smart contract transaction that, if broadcasted, closes the channel automatically but have multiple ways of spending it further, and one of those ways allows a party to get all the funds if he has proof that the counter party cheated (closed the channel using and old-state transaction).
So those transactions that are created are never published if both party cooperate, instead, they serve as a forced-closing mechanism if the other party is uncooperative
That was just a high level view of updating channels, but opening a channel and routing a payment is another story