I am just wondering how a switch does know how to route packets to destinations "hidden" behind another switch. In my understanding a switch has a table that maps each of its hardware ports to exactly one MAC-address. So far so good, when a packet/frame (?) arrives it now can determine the port at which the packet should be routed.
But what happens when there is another switch connected to one of these ports and this second switch has more than one devices connected?
I am wondering how a switch is able to resolve this (on OSI-Layer 2, without a router), as I think this does indeed work in reality (?)
I am sorry if this question already exists (I think so, it should not be that uncommon), but I could not manage to put my thought into a suitable search query.