It sounds like your horse is doing something called 'rooting'. It's sometimes a tactic of school horses to evade the rider's instructions by making them lose contact. My own horse does it with students, and every now and then she will test me too. Because many beginner riders don't know how to cope with rooting, horses quickly learn that putting their heads down and pulling the reins out of the rider's hands is a good way to go the direction they want to...like the nearest patch of green grass, or the barn door. I've known horses that were very quick at dropping their heads and either pushing their noses out, or turning their heads quickly, so that if the rider has a tight grip on the reins they get pulled forward out of the saddle. Or, it just plain hurts when they pull the reins through your hands.
When it comes to playing tug-of-war with a horse, the horse will always win. They are just stronger than us. That's why pulling on the reins doesn't work. And you're right, pulling hard when a horse roots will hurt the horse's mouth and eventually make him more insensitive to rein aids.
The trick to dealing with rooting is not to pull back on the reins, but to ask the horse to keep moving forward. As soon as you see the horse starting to put its head down to root, push it forward with your seat and leg aids. This should bring the horse's head up, and make it easier for you to keep the reins from slipping through your hands, or re-organizing if they do get pulled. It shouldn't take long before the horse realizes that this tactic isn't going to work with this rider, and the horse won't try it all. (They'll remember to use it with a rider that doesn't know how to cope of course!).
You have to learn to recognize the signs that your horse is going to misbehave either to root, or sneak a snack of grass. Often it happens as you pass the barn door or the gate. But if you watch your horse, you'll quickly learn when the behaviour is about to take place. As soon as you sense the horse is about to put its head down to root, use your seat and leg aids to tell it to walk forward--now!