A switch is a hub that isolates other machines on the network from each other's network data traffic. What a switch adds is that the only network traffic sent out each port on a switch is data that is addressed directly to the machine connected to that port or else is being broadcast to everyone. The only advantage to a switch is your PC will not be interrupted to look at data sent to other machines on your local network and there will be less retransmission because of collisions on the network. Your non-switch connected PC would look at every packet on the network and throw away the packets not addressed to it, but this takes up processing time on your PC. If only one computer is running on the local network at a time, there will be no benefit at all to the having the switch. Many routers at the consumer level are also switches. Since switching routers are often about the same price as non switching routers, you may as well get the switching router instead of the router without the switch.
And that worked? You could use both computers on the net at the same time? Well, that's pretty surprising, both computers must have gotten IPs from the ISP. Are you sure you had a plain hub, and not a router/hub? The difference between hubs and switches is that a hub is like twisting all the cables together. Every device connected to the hub sees all the info flying around. A switch just sends info for a particular device to that device, no other device sees it. So switches are better and faster than hubs. A router is a device that basically allows more than one device to use the same IP address, and makes sure that the right data goes to the right device (by assigning each device it's own IP different address). Many routers are combined with hubs and switches, among other things. For instance, I am running a switched router that also has a printer port. It's a switch and a router and a print server.
OK I see. Thanks for your replies. I am not sure I ever had multiple IP addresses, I only paid one subscription or maybe an extra charge. Not sure, it was with Cox cable, networking was not supported but it worked.