What is the difference between 2.4 GHz and 5 GHz WiFi?
The two bands trade range against capacity, and neither is better in general. The lower frequency travels further and passes through walls more effectively. The higher frequency carries substantially more data but weakens faster over distance and is absorbed more by obstacles.
Congestion is the other half of the picture and often matters more than the raw specification. The lower band has few non-overlapping channels and is shared with a great deal of other equipment, including older cordless phones, some baby monitors, Bluetooth devices and microwave ovens. In a block of flats it can be genuinely saturated. The higher band has many more channels and far less competition, so even at similar signal strength it frequently performs better.
The practical guidance follows from that. Use the higher band for anything nearby and bandwidth-hungry, such as laptops, televisions and phones in the same room. Use the lower band for distant devices, for equipment that only supports it, and for low-bandwidth sensors and smart home devices scattered around the property.
Many routers present both bands under one network name and decide for you. That is convenient but the decision is not always good; devices sometimes cling to the lower band after wandering away and never switch back even when they return. If you have a device that is inexplicably slow near the router, this is a likely cause, and separating the bands into distinct network names gives you direct control.
Newer equipment adds a third, higher band offering more capacity again with correspondingly shorter range, which follows the same trade-off rather than changing it.