The first time you attempt to join a given Wi-Fi network takes more effort than subsequent attempts. After that the first connection, the iPhone "remembers" that Wi-Fi network and, unless there is a problem at the network end (having nothing to do with your iPhone), future connections to that network are automatic.
Here are the steps required to join a Wi-Fi network for the first time:
Closed networks: These steps work for Wi-Fi networks that broadcast their availability. For help with joining a closed network, see Join a Closed Network, a few pages ahead.
When the iPhone first detects a Wi-Fi network, by default, the iPhone asks if you wish to join it. If more than one network is available, they will all be listed (Figure 11-1 ...