As a concrete example:
My switch has a total of 28 ports, four of which are 10 Gbit/s. It can switch 64 Gbit/s in hardware and can also route in simple cases. However, in more complex routing, it only achieves a little over 1 Gbit/s. The router, on the other hand, can only switch 20 Gbit/s but in most cases can also route 10 Gbit/s, because the CPU is connected to the switch with 10 Gbit/s. You can definitely notice that, and it can also be proven with measurements.