Yeah this point is key, these devices are typically designed to forward traffic *through* the device, and most have hardware ASICS for this purpose.It also can not achieve much above 600Mbps as a iperf3 client/server (you do not need to run iperf3 on the router anyway).
Traffic which is sent *to* the device itself is not a typical use case so its handled in software rather than hardware, as the market is price-sensitive there's no point investing in improving performance of a niche use case.
But point is, CPU and RAM are not the only considerations - with good hardware acceleration you can achieve better performance providing you stay within the the parameters supported by the hardware. Stray outside of these and you will fail over to software forwarding where the CPU/RAM will play a major part.
To give an older example, an original Cisco 3750 is capable of 13gbps layer 3 routing in hardware, but it has a 250mhz PowerPC405 cpu. If your configuration causes it to fail over to software routing, you won't even see 1gbps.