Door locked even when the door remains open

I was painting the door frame so I kept my door open. I realized the door locked even with the door open. That means if for some reason someone left the house open the door will lock and I will get a notification my door is lock…this is how it should work?!!