I feel like you would benefit from revisiting the OSI model
https://youtu.be/tkySicWdTa4?si=vivkiWeqGKyW5Wxj
Switches can have many different purposes, and can act as a router or not. This series of videos covers the OSI model, and provides some information on how many layers of the OSI model an individual switch can capture.