These days word "layer 2" refer to so many things, such as sidechain (e.g. Rootstock), payment channel (e.g. Lightning Network) or even fake layer 2[1]. But generally the difference is,
1. Layer 2 depends on layer 1. If layer 1 stopped operating (e.g. doesn't create new block), it would halt the layer 2 as well.
2. Layer 2 usually have lower TX fee and faster confirmation, usually at expense of centralization (e.g. Liquid) or technical complexity (e.g. Lightning Network).
[1]
https://blockspace.media/insight/most-bitcoin-layer-2s-are-marketing-scams/