1) a layer 2 switch routes traffic based on the MAC address.
2) a layer 3 switch routes traffic based on the IP address.
TechTarget has a great web site for definitions of terms like this, and I encourage you to use it often. The link is:
At this site, search on the word “switch” and you’ll get a much more detailed description.
Have a great day,