I’m not certain it’s being done for 100% of bills, but it would be easy to track any single bill between being withdrawn from an atm/bank and re-entering one by noting the serial number and account number as it comes and goes. Exchanges will certainly happen between withdrawals and deposits, but still your privacy is only preserved when neither of your counterparties withdraw/deposit the bill
I always just assumed that somewhere in the banknotes lifecycle those serial numbers are all getting written into a database… I kind of assumed that based on examples where the government was able to trace where large amounts of cash had come from and what it got spent on when doing major crime investigations or things like DB Cooper and how confidently they proclaim that none of the cash (that wasn’t “lost” and then found by various searches or the public over the years) was ever spent. I assumed it was probably part of obligatory regulations to do with money laundering or something equivalent and thus they all had to do it.