There's something called Wi-Fi priority, adjustable for some phones in
Settings - WiFi - Advanced - Wi-Fi priority, and also via some apps and Xposed modules like GravityBox. Android maintains this list of remembered access points and assign priorities to each of them.
I can't find an official definition of how the priorities are (re)assigned (Android Developers only tells me that priority exists), but apparently when you are receiving 2 remembered APs and connected to one of them, then connect to the other, the latter one will receive a boost in priority.
I don't have an idea how "private" networks affect how it works, though.