The iPhone has access to 2 kinds of networks - WiFi and Cellular.
Wifi is like home or work and is just your local network that then connects to the Internet via Cable, DSL, T1, etc.
You can use your phone's WiFi to get on a WiFi network, but if you don't have the password you are stuck. Also, WiFi is only good in WiFi area (100Ft), so when you leave work, home or starbucks, you have no WiFi.
iPhone also has access to Cellular data networks - both 3G and Edge. 3G is faster, almost like on the Internet at home or work. Most anywhere you have cell coverage and can make a call, you have Internet access. Sometimes you are on the slower Edge network.
The ATT data plan is for this Cellular data access provided by ATT. So you can usually get online just about anywhere. WiFi is generally faster and uses less battery, but you need to have free WiFi nearby to make it worthwhile.