Home routers broadcast on two radio bands. The 2.4 GHz band travels far and passes through walls well, but it is slow and heavily crowded — microwaves, baby monitors and every neighbour's older network share it. The 5 GHz band is much faster and far quieter, but it fades quickly through solid walls.
Many routers present both under one network name and choose for you. That works well most of the time, but devices can cling to a band long after it stopped being the best choice, which is why a phone carried upstairs sometimes crawls until Wi-Fi is toggled off and on.
The practical rule is simple: fast things close to the router belong on 5 GHz; far-away or low-bandwidth things belong on 2.4 GHz. A television in the same room should be on 5 GHz; a smart plug in the garage should not.
Some devices — older smart home gadgets in particular — only support 2.4 GHz and will refuse to join a 5 GHz-only network, which causes a lot of confusing setup failures.