The problems come when more than one computer talks at once. Because hubs transmit all traffic over all ports, when two or more computers are talking at once, the data packets crash into on another. These are called collisions, and slow down network efficiency. This is where the term "Collision Domain" comes from. When a data packet collides, every computer will get to hear about it and pause its own transmissions for a random amount of time, thus slowing down network performance.
Routers are much cleverer than hubs, in fact they could be classed as computers in their own right. They have the power to manipulate network traffic and apply rules to it, as well as divide networks and domains, act as a protector of networks and otherwise manage network traffic. A router knows what devices are connected to it and their IP address. It also knows what other routers are connected to it, if any.
A router breaks up networks by the mere fact that it doesn't just repeat traffic over all its ports, it routes them intelligently via a set of rules called a routing table. It knows where to send the traffic, and what port to use to get it there. So if two computers talk at once, the router will queue the traffic, decide where to send it and send it on its way.
The difference between a router and a hub might be brains or processing power, but as you have seen there is much more to it than that. Check out my article on "What is the Primary Purpose of a Router" to find out more.