The OS is written so that the phone uses the fastest connection available. For most of us, that will mean WiFi first, then 3G, then EDGE, then GPRS.
If you are within range (~100 feet or so) of a WiFi access point, the phone will automatically choose that data method, as long as it's either an...