Lockpicking is one of the stealth skills that are available in Skyrim. There are 5 different levels of locks: Novice, Apprentice, Adept, Expert, and Master. As you go up in difficultly it gets harder to find the "sweet spot" on the lock.
Use to rotate the lockpick, then to rotate the lock. When you rotate the lock, the closer the lockpick is to the correct position, the more the lock will rotate before the lockpick breaks. Only when the lockpick is in the correct position will the lock fully rotate and open.
Lock difficulty ranges from Novice (easiest) to Master (very hard). The more difficult the lock, the smaller the correct spot is. The better your lockpick skill, the larger the correct spot will become.