I remember reading somewhere that when you connect to a Wi-Fi network, Apple tries accessing their own URL which is guaranteed not to follow any redirects. (E.g. http://apple.com/no-redirects). If it sees a redirect, it assumes you are on a Wi-Fi network that needs you to login, so it presents the login screen. Otherwise, if it was able to reach that URL with no redirects, it will just assume you are connected to the internet normally.
What is this URL, and where can I get more info about the mechanism Apple uses?