If your opponent has a higher level, the move will never hit. Also pokemon with the Sturdy ability will not be affected.
The accuracy does vary slightly based on the level difference. The formula is:
Accuracy = (User's level - Target's level) + 30
So if the pokemon are the same level it's 30% accuracy. If the level difference is 70 or more it's 100% accuracy!