well, this paper describes how 802.11__ devices choose a given AP (BSSID) when there are multiple available for a SSID:
https://www.usenix.org/legacy/events/imc05/tech/full_papers/vasudevan/vasudevan.pdf
From the paper, it indicates that the primary determinant is the calculated bandwidth to each AP (measuring up and down separately), based on a passive (reciever-only) measurement, by measuring the time it takes for the client to receive beacon frames from the device, advertising its presence and services.
Things like congestion, optimal route determination, and other runtime considerations that would require a back-and-forth with the APs do not appear to have bearing on the decision.
Implementation is up to the manufacturers, but I would hazard a guess that when there is only one AP, the comparison is still made, its just that there is a clear winner, since there's only one horse in the race.
Note, this kind of thing does evolve over time. for instance here is a paper on a more full fledged algorithm released just this last March: http://www.eecs.berkeley.edu/Pubs/TechRpts/2014/EECS-2014-104.pdf . I'm certain it hasn't made it into any device specs as of yet however.