Lightning is a protocol and there can theoretically be many disjoint networks. The biggest network is usually what's considered to be 'the' lightning network. Double spending, which would require 'settling' a superseded lightning transaction, is prevented by a penalty mechanism that makes it so the malicious party loses all the funds in their 'channel' when caught (which will be, at smallest, the amount the original payment was made for).
I'm still thrown. I don't see how an after the fact penalty can work.
Let's say I have 1 BTC. I buy something for 1 BTC on lightning network A. Simultaneously (within nanoseconds) I buy something for 1 BTC on lightning network B. I never plan to use BTC again (or if I do, I will use a different wallet, etc.) Do I just get two purchases? Is there a meta-network clearing house, and if so, why are there many disjoint networks.
Or do I need to have moved my BTC into the lightning network A or B before I spend it?