What is the scientific principle involved in unmanned level crossing?

You obviously want to avoid collisions with, or between, trains. In the USA we call them railroad crossings; India and Britain seeem to prefer to call them "level crossings". Automatic crossing gates can reduce collisions but sometimes drivers try to around them when they shouldn't. The Los Angeles Metro system has had several collisions per year, and still has some crossings without gates.