Linux has been attacked for years, there have been rootkits and exploits out there since the early days of slackware... Linux has had a significant presence on servers almost since its inception, and is now starting to make inroads in many other markets.
On the other hand, what people think of as "linux" in this context is a multitude of different versions of the linux kernel with various modifications and all manner of different userlands running on top. Literally anyone can build a linux-based system and pile whatever garbage software they like on top of an ancient version of the kernel.
Windows on the other hand comes from one place, in a small set of versions, and all of the vulnerabilities attributed to windows are present in this version and usually in a default configuration.
Microsoft fully control the versions of windows being released, and if a third party produces a device that bundles a windows install but has some additional vulnerable software running on top of it or a stupid default configuration (eg default passwords) that vulnerability is blamed on the device vendor and not on windows.
There are no shortage of such devices, and they routinely get compromised not only due to their own poor configuration but also because of vulnerabilities in windows itself (eg eternalblue).
When it comes to embedded devices, Linux is massively more widespread than windows, most people are likely to have more linux devices than windows and usually don't even realise it, only a subset of these devices are getting compromised because the manufacturers of those devices make stupid mistakes when building them and then fail to either provide updates, or provide a user-friendly way to apply them.