Layer 2 (L2) is a network or channel that sits on top of a Layer 1 (L1) network like Bitcoin or Ethereum. L2's are designed to enhance the speed and reduce the cost of performing transactions on a blockchain.
L2s improve blockchain scalability by reducing the number of nodes or participants required to validate transactions within the L2 network, thereby reducing the time it takes to achieve consensus.
All confirmed transactions on an L2 are periodically batched together and submitted back to the L1 where they are validated as one large transaction and added to the next block on the L1 chain.
Lightning network is an L2 solution for the Bitcoin network. Polygon and Loopring are L2 scaling solutions for the Ethereum network.