The router does the routing from one vlan into another. The switch has a funktion to apply the traffic with a specific vlan-tag.
E.g.
On the switch: to your PC vlan 3 could be applied and for your fridge vlan 25.
On the router: You can allow vlan 3 access to the Internet but vlan 25 not. For management purposes you could allow vlan 3 access to vlan 25 but not the other way around.
The router does the routing from one vlan into another. The switch has a funktion to apply the traffic with a specific vlan-tag. E.g. On the switch: to your PC vlan 3 could be applied and for your fridge vlan 25. On the router: You can allow vlan 3 access to the Internet but vlan 25 not. For management purposes you could allow vlan 3 access to vlan 25 but not the other way around.