That's used to detect magnetic fields. There is a bar code on the book and a magnetic field on it, just like when you go to the door of the supermarket. When you pay something, the cashier will scan the bar code with the instrument, which is called degaussing, or the detector at the door will ring. If you pass the instrument without degaussing, there will be an alarm, and the degaussing will not sound until the cashier pays with the instrument.
I hope my answer can help you, Zhou from Baidu Know Team. If you are satisfied, please adopt ~O(∩_∩)O~