It's an automatic door locker/closer. If the door is left slightly open it will automatically close it.
It will do it whether you close it hard or soft.
From what I've understood it's better that you don't slam it. I'm not in the habit of it, so I've gotten used to it.