When connecting to a WiFi network, Windows will always favor the strongest one available. If you’re in range of several known WiFi networks, Windows will favor the one with the strongest signal strength and not the one that’s faster or has fewer devices connected to it.
Full article