If you are using iPad smart cover, most iPads are auto-locked as you closed them with magnetic smart covers. If you found that the auto lock function has just stopped working on your iPad, you no doubt to have accidentally toggled the setting in your iPad. This may apply to Apple’s iPad Air, iPad Mini and iPad Pro.
In this case, you have to press the top button of your iPad for the screen to go off/on every time. This is so terrible!
Web Cool Tips has just found a clue on what is wrong here and give you a great solution.
Just go to your iPad’s Setting > General and toggled the ‘Lock/Unlock’ button to enable/disable the auto lock function.