a network switch
A switch is the smart box at the heart of every modern wired LAN. Picture a mail-room clerk who knows exactly which desk each person sits at: when a letter comes in, the clerk reads the name on it and walks it straight to that one desk, not to everyone in the building. A switch does the same with Ethernet frames and MAC addresses.
A switch has many ports, each connected to a single device by its own cable. It works at the data link layer and is store-and-forward: it receives a whole frame, checks the CRC, reads the destination MAC address, looks that address up in its MAC address table, and forwards the frame out only the one port that leads to the destination. It learns where each machine is by remembering the source MAC of every frame it sees (MAC learning). If it does not yet know where a destination is, it floods the frame out all other ports, just once, until it learns the answer; broadcasts and multicasts are flooded by design.
Because each port is its own link, every machine gets the full link speed and can send and receive at the same time (full-duplex), and collisions essentially never happen — each port is its own collision domain. This is why switches replaced hubs entirely. A plain switch still forwards broadcasts to every port, so the whole switch is one broadcast domain; separating broadcast domains needs VLANs or a router.
Three PCs on a switch. PC-A sends to PC-C; the switch reads the destination MAC, finds it on port 3 in its table, and forwards the frame out port 3 only. PC-B never sees it and is free to talk to anyone at the same time.
Targeted forwarding by MAC — the opposite of a hub, which shouts to everyone.
A switch is a layer-2 device: it forwards on MAC addresses and breaks up collision domains, but it does NOT break up the broadcast domain and does NOT route between IP networks. That is a router's job.