Banknotes (not coins) have serial numbers. Why? Because this allows them to have (limited) traceability.
If you ever get a banknote from a bank robbery, abduction etc and the serial number of it is marked as "tainted", then you will have a huge problem if you try to deposit it in a bank.
Yes, it is possible to taint banknotes either by putting invisible ink on them or having their serial numbers treated specially when they are used at certain financial institutions.
It is easy for the government to check if a banknote is tainted but it is very difficult to get a list of people who own tainted banknotes. Tainted banknotes serve well when the police needs to catch someone taking bribes, but when they circulate in the society it is very difficult to find the path of a tainted banknote.
With government-controlled electronic money (bank money used in credit/debit cards and CBDCs) they don't even need to specially taint anything. All transactions are visible to the government.
So we can say that the banknote anonymity is not perfect but it is quite good compared to that of the government-controlled electronic money.
It's the same thing with tainted BTC (from MtGox, Silk Road etc.) and CEX (crypto banks).
The tainting provided by the various "chainalysis" companies does not work perfectly because transactions have multiple inputs and outputs and that is why these companies return a probability score instead of a true/false flag. I am skeptic of their reliability, but putting aside that, the real problem is the KYC. It is similar to writing a report to the government each time when you buy something at the corner store or lend $100 to your friend.
The European Commission works relentlessly on turning the EU into a totalitarian state, so I wouldn't be surprised if sooner or later they introduce banknotes with RFID chips. But this kind of "cash" will have very little in common with the real cash that we use now.