Its basically just a network that creates a wireless access point on your laptop that lets other computers see that wireless point and connect to it. Its like connecting to a wireless router accept its just connecting to another wireless card. http://www.cs.washington.edu/research/edtech/presenter/doc/adhoc.html
Very easy to create one. On vista its like 3 clicks.
You have to jailbreak your iphone for it to work as a modem though. There are various programs once your jailbreak it that you can add through cydia (basically a jailbreak app store if you dont know what it is).
The iphone has some setting built in where if it cannot connect to the internet through its wifi connection it will kick back over to its 3G/Edge while keeping the wifi connection active.
Thats basically what it does the Iphone and computer get connected through the wireless network (you can use a usb cord too) and when the computer tries to use the wifi connection to connect to the internet the iphone tries to use the internet and when it cant find it kicks back over to 3G/Edge and keeps the wireless connection in the background. So the computer is still connected and can use the phones 3G connection as internet..... Atleast I think thats the basic premise behind it.