I'll answer your question title: they can't, and do not.
There are some possibilities to solve this problem.
Use an external power supply. This usually is a common wall wart that powers all the downstream ports, but not the hub chip itself that is powered by the host.
Limit the maximum power, either writing it up somewhere or adding some protections like polyfuses or something like that.
Rely on the protection of the host. Modern usb ports are quite stiff so this might actually work well but you know... Building a usb ports killer device is not good.
What would happen if you overload the hub? In case one we're assuming you can't overload it, i.e. the external psu can deliver all the necessary current to each port. In case two and three protection kicks in and the downstream power is likely disconnected, saving the pc usb port.
As a side note you seem to rely pretty much on the fact that the USB standard says something (when you speak of max current). Remember one thing: there's no such thing as usb standard, there's literally thousands of manufacturers that do not care about the standard, or implement a subset of it. Having a full 500mA power port is actually quite rare in fact.