Routers are used to take in information and forward it to a specific IP while a switch simply passes along information arbitrarily. Which would explain why on my home's wirless router, up to 4 computers can be connected to the router but be doing different things and getting different info. If a switch were to be placed all the computers would get the same info.
Almost, but not quite. Are you familiar with the OSI 7 layer model? A router is essentially there to connect more than one network together, it works on the network layer of the 7 layer model and hence acts as a gateway between different networks.
In contrast to this, a switch works on the data link layer, so it can't route between networks. It can however look inside packets and forward them on to only where they need to go within the same network, it doesn't just pass it on arbitrarily to all the ports it has. That would be what a hub does (or an unmanaged switch, which is basically just a glorified hub) it just copies all the data it receives to all of the other ports. It sounds like your view of a router is actually what a switch does, and your view of a switch is what a hub does
As an aside, a hub will still work fine but if you've got lots of traffic on your network it'll be considerably slower than a switch. This is because it's nature (forwarding everything onto everything and just letting each node deal with its own traffic) creates LOTS of collisions which destroys data packets. You don't notice things going wrong because it's all handled, corrected and resent for you in some of the lower levels of the OSI model - but the end result will be greatly reduced speed as more packets collide and have to be resent. This is why the proper corporate gigabit switches cost a lot more than the cheap home sort - chances are the cheap home sort are actually unmanaged switches (hubs) that won't give you anywhere near gigabit speed when there's lots of traffic flying around. Proper (managed) switches however should maintain their speed however many devices are connected.
To confuse things though, in a home environment, the router that you get given by your ISP to connect to the internet is in fact usually a multifunction box. The router part is the part that manages the connection between your LAN and the internet (acting as a gateway between the two different networks.) The switch part is the part that manages the traffic going from machine to machine in your LAN. And the wireless part is just a wireless access point built in!
So, you'd use a router when you had more than one type of network to connect together and a switch to manage traffic within the same network. You'd use a hub when you were too cheap to buy a proper switch and / or you understand the drawbacks of a hub and know that it won't affect you too much
Hope that helps, say if there's anything you want clarifying!