I always thought it was just a safety switch but imo it should do more than that because when you open the battery door even without it, you break the circuit since the contact on the door don't make contact with the batteries anymore.
I believe it is used to measure the battery level or to power the board. But i can be very wrong here.