Consider the following 3 nodes, A, B and C.
At time t=0, A has 10 bitcoins. A sends 6 bitcoins to B. Then, A attempts to send 6 bitcoins to C.
With on-chain transactions, the second transaction is prevented, because everyone knows A's balance at all times.
How is the second transaction prevented if the first transaction is made on the lightning network?
If we assume that A, B and C are all connected to the same LN hub, called D - and the payments all route through D - then I can see how the double-spend is prevented.
But what if there is no path through LN connecting B and C? Or, there is a path, but A chooses a different route for its second payment compared to the first payment?
Finally, what if the first payment is made via LN, but the second payment is on-chain?