Layer 2: Layer 2 has the task of scaling some blockchains (in theory, slower networks like btc and eth) 2 very common examples that we have on the ethereum network are Polygon and Optimism, a classic example of the bitcoin network it's the lighting network. As the bitcoin network is slow in its base layer, the lightning network contributes to the scalability of the network and makes transactions much faster.
The most interesting point here is that, as we know, cryptocurrencies like btc and eth are extremely secure and, consequently, as these secondary layers are built within the blockchain of these cryptocurrencies, they end up inheriting this security.
There are projects like Solana and Avalanche that seek to bring this "scalability" right into their base layer, however, they may end up compromising the security of their respective networks. That's why they are considered very bold projects. These second layer protocols process the information outside and then play the transactions inside the primary blockchain, thus facilitating the scalability of the network used.