Switches and VLANs
Hub
The switch's ancestor: it repeats every frame out of every port, so everyone hears everything.
A hub has no table and makes no decisions: a frame in on one port goes out of all the others, and only one device can talk at a time (one collision domain, half duplex). A switch learns which address is behind which port and sends each frame only where it belongs. That is also why sniffing works on a hub and not on a switch, unless the switch is tricked into flooding (MAC flooding) or the attacker gets in the middle.