Door sensors always say On. Access control changes

How does Home Assistant decide what to map to binary_sensor when it comes to door sensors? I picked up 2 Aeotec ZW120s. Both of the binary_sensors created for them always say “On”. However, the access control is 22 when open and 23 when closed. Easy enough to make the changes in my automations, but I was wondering what and how things are mapped to the binary sensor.