We basically dealing with the OSI model but in this post we specifically focusing on the Layer 2 and 3 aspect of the OSI model but it is worth knowing the OSI model in the long run.
So switching happens at the layer 2 network based on destination mac addresses whilst routing happens at the layer 3 network. Layer 2 has its own broadcast domains.
Layer 3 involves static routes and the management of how traffic is handled based on IP addressing and much broader than just internal source destination in a broadcast domain.
Thank you for reading.
Regards,
@trev03