hubs work on physical layer, all the ports share the broadcast/collission domain, which means collissions happen when more than one hosts try to send bits at the same time.
switches work on data-link layer, every port owns its own broadcast/collission domain, no collissions will happen, which means all the ports can maintain their 10 or 100Mbps bandwidth.