Sidechains are not protected by Layer 1 and they have their own consensus, unlike Layer 2.
And if we also introduce the State channels in the comparison? I deduce that they are pay channels. Are they not the same as an atomic swap?
No, atomic swaps take place across blockchains.
[/quote]
The Technology Behind Atomic Swaps
A valid transaction requires a signature. This signature can only be created by the person that has access to the private key. When you send a transaction you usually sign it and broadcast it to the network afterward. HTLCs are based on a technology called state channels. All you need to know is that they allow you to exchange signed transactions securely. Only once the participants decide they are done transacting, the final state is broadcast to the blockchain.
The Hashed part of HTLC means that a hash serves as a lock for the contract, to protect it from a third party accessing it. The Timelock part refers to the contract having an expiration date.
Two conditions must be met to perform an Atomic Swap between two crypto assets: Both assets and their underlying blockchain need to support the same hashing algorithm, like SHA-256 in the case of Bitcoin and both blockchains need to support some kind of programmability that allows an HTLC to be deployed.