Ok I guess we have to start way in front of your question to not just answer your question but give you an understanding.
First of all, what does a switch do: A switch has for example 24 ports and all ports are connected to the CPU of the switch. When a pc connected to the switch wants to reach the router to access the internet he asks the switch to really the data to the router but the switch doesn’t know where the router is so it sends on all ports „Hey are you 192.168.0.1(for example if it’s the gateway in your network config)“ then on one port the router answered „yes“ and the switch makes a note on a list that this up is on port x. So over time the switch knows who is where and what speed does the port support. Because said CPU has a bandwidth normally greater than the sum of all ports (rock a Unifi 24 port switch by chance and it had 26gbit bandwidth) it can for example connect 2 pcs transfering files with a full gigabit all while running a download from the internet router to a third pc with no problem. So as long as you don’t want to access one ressource with multiple PCs you have full speed and if you do the packets are stored in a small buffer and if it is full the PCs are told to wait a millisecond and it is transfered in a first come first serve method so everyone can get data through.
All a router does extra on top is have an extra list if he doesn’t find the receiver of the packets internally he notes the address of the PC that asked and sends the request to the wan port and when someone responds he know who to send the response internally.