Many have a policy of destroying records immediately after books are returned unless you request otherwise (eg to be able to see your borrowing history in your account.)
Good question, and I'd be curious to know...but I'm not really sure.
My sense of most libraries doing that is more anecdotal than quantitative. Mostly just what I've heard from librarians and my experiences signing up for library cards various places that had some sort of relevant T&C clause or opt-in process.
Many have a policy of destroying records immediately after books are returned unless you request otherwise (eg to be able to see your borrowing history in your account.)