macOS always defaults to the 5 GHz band over the 2.4 GHz band. This happens as long as the RSSI for a 5 GHz network is -68 dBm or better.
If multiple 5 GHz SSIDs meet this level, macOS chooses a network based on these criteria: