You have to understand how speakers work. They convert electrical signal, through the wizardry of electromagnetism, into sound. Basically, if you have electrical current, you have magnetism, and vice-versa (that isn't the whole story, but yea).
So, if your subwoofer is humming, it means there is some piece of electrical equipment or otherwise causing electromagnetic interference in the vicinity of either your subwoofer or any of the wires connecting it. Since you say it happens when connected to your laptop as opposed to your desktop, I think the most likely reason is that there is a power cord in too close proximity to either your sound card of any of the sound-signal carrying cables between your sound card and the woofer. Sometimes you can do something about it (move the power cable), sometimes you can't (battery is right next to the sound card's ports). In the latter case, you can buy better shielded sound-signal carrying cables, or an external sound card of some sort.