Here is my understanding of the difference of these several kinds of boxes which help make a network. I would be glad to receive any differing opinions. More history and details may be found here.

The original idea of Ethernet was a single wire attached to all of the computers in a room or building. This would be a coaxial cable if it was of significant length and engineered so that a signal imposed by one of the computers would appear at each other computer just once and not reverberate. In engineering terms the cable was a transmission line. This is in contrast to the more conventional computer wiring that waits for the receiver’s confirmation before sending another bit on a wire. Without further coordination each computer puts packets on the cable when it is idle. These packets have 48 bit source and destination addresses.

The hub allows branching of the cable which then might form a loop-free tree of cables with the same appearance to the computers. The hub may shape and amplify the signal. The hub sends the incoming signal out on each of the lines that it did not come in on. I don’t know how smart it is upon packet collisions. It has no storage beyond about one bit. Ethernet theory calls this a Repeater and includes bridges in the hub category.
The bridge examines the 48 bit destination address for the packet and directs the packet only to the cable where the recipient resides. One packet causes less congestion thereby. A bridge may buffer enough bits to interpret the destination address. It could buffer a whole packet and queue it for the correct outgoing link. I don’t know if they do. Bridges learn who’s where by watching return addresses. Bridges may join into the Spanning Tree Protocol.
A switch will typically talk some protocol besides Ethernet, such as PPP over longer lines provided by the Telco. The switch knows about IP (internet protocol) packets within the Ethernet packets and routes according to 32 bit IP addresses. The switch will typically buffer and queue packets. It will to talk to the LAN with Ethernet as well.
“A router is a node that forwards IP packets not explicitly addressed to it.” The router talks PPP over very fast links such as fiber. It probably talks only to switches and other routers. Routers must be know to confine packets with IP addresses that are of local scope. Network Address Translation (NAT) happens in routers.
Check with this