Wi-Fi 6 devices are capable of using the 2.4 and 5 GHz bands because they contain two radios (dual-band), each of which can communicate over one of the two spectrums.
The 2.4 GHz band has 3 non-overlapping 20MHz bandwidth channels and one 40MHz channel. The 2.4 GHz band is ideal for sending moderate amounts of data over long distances.
The 5 GHz band has 25 non-overlapping 20MHz channels, 12 40MHz channels, six 80MHz channels, and two 160MHz channels. The 5 GHz band can send larger amounts of data but over shorter distances.
Devices that can communicate over both the 2.4 and 5 GHz bands can take advantage of the discrete range and capacity each spectrum provides while greatly reducing interference.