Have to agree and disagree with some of the above and also get back to the OP.
Equalization, for most people, is not difficult; moreover, the Valsalva manoeuvre, which sounds a bit technical but is just the basic "pinching your nose and blowing against it" works just fine for the majority of divers. It can be aided by the Frentzel manoeuvre, which is swallowing, and it can be further aided by pinching and blowing, swallowing, and wiggling your head back and forth, and I don't know what that manoeuvre is called but it works.
Equalizing on the surface is a good guess - but it's only really relevant if somebody has a problem equalizing at the surface because - well - you're almost equalized anyway. During every beginner dive I've ever taught I asked people to try and "pop" their ears during the briefing but that does not guarantee that there will be no problems underwater, and failure to pop at the surface does not mean that there really will be a problem under water, but it's a good guideline for instructors and divemasters to follow - if a person has a problem at the surface, then we need to pay more attention to them underwater.
Slow practice, step by step, with a super slow descent, equalizing every few centimetres will help. Most people who have problems with equalization simply do not make efficient use of the technique, or don't really understand what's involved no matter how well it's taught - but once they get it right then the lights come on and it's quite simple after that.
There are some physiological reasons which prevent people from equalizing. Again, they are mostly straightforward blockages due to congestion - which is a term that is also misunderstood. Most people would automatically associate the term "congestion" with the symptoms of the common cold and this is true - but even after the symptoms of the cold have faded, plenty of gunk can remain in the sinuses. You might be able to breathe just fine through your nose and mouth, but that does not mean that all the tubes are cleared. The person may have had a nosebleed recently meaning there is clotted blood hanging around, or an infection, or other stuff that is not completely blocking the airways at surface pressure, but may impede airflow very rapidly at even the shallowest of depths if not properly equalized. All sorts of stuff grows or gets stuck in the nasal passage and sinuses without us even knowing it's there.
There are also physiological deformations of the palette, septum and Eustachian tube which go un-noticed on land but become problematic underwater. They are not common, but they are not rare, either. Other people have stated that equalization was perhaps not taught correctly and this is entirely possible but in my opinion unlikely, because as instructors we rely on people having a good time underwater in order to keep the business going and not, for example, trying to get them to enjoy the underwater world in perpetual agony. It is true, however, that many instructors do not necessarily understand all the various possibilities that may preclude a person from successful equalization.
If, after exhausting all possibilities, a student diver is unable to equalize then it may well be that there is a physiological problem which needs medical or surgical attention if the person wishes to continue to dive. A dive centre that will not refund a student in lieu of this should, in my opinion, be struck off the register. I've dealt with a fair few cases over my time as an instructor and I have endeavoured to give the customer the best possible experience that they can have given the circumstances, refused to continue training until the problem is resolved, and in every case I have consulted with my manager if necessary and refunded course fees as appropriate. Every student diver has the right to discuss what happens in different circumstances in advance of payment.
It's a problem with a lot of questions and a lot of answers and it is often the case that neither are correct. I hope this post has helped somewhat.
Cheers
C.