I've seen some people ending up here while searching for "How ViseGrip Pliers Work" so I've decided to put up a short explanation. The principles are pretty simple, and while I could walk through the math and the free body diagram I'm going to try and do it with words and pictures.
It all starts when you squeeze the handle (see the dark blue arrow). The handle is just a long lever which pivots around the lower point on the jaw (the dark blue circle).
When it does this, it expands the distance between the jaw and the adjusting point (light blue circle). This causes the jaw to pivot around the top pivot point (green circle) which forces the jaws to close (green arrow).
Each of these interactions multiplies the force so that a large movement of the handle results in a small movement in the jaws. The ratio between the movements is the inverse of the ratio of the forces. That is, if the handle moves 1 inch for 1/10 of an inch movement of the jaws, a force of 10 pounds on the handle results in a 100 pound force at the jaws.
Now, the locking part. See the light blue arrows? When the angle between the light blue lines is less than 180 then they will tend to re-open by themselves. Once they reach 180 degrees (a straight line) or slightly more, they will lock. The same principle is true of things like your elbow or knee. The problem with this is that with a rigid mechanical thing, getting them out of the locked state is not easy. With your arm you can just ease off on the pressure so it is not typically a problem. To get out of this situation, the visegrips use a small lever on the handle. If you can look closely you will see it and a small bump it presses against. It does just the opposite of pressing on the handles and has the pivot even closer so that it can pry the lever back to an open state.
The final thing to consider is the adjustment. This is done through the screw on the back of the handle. Twisting it moves the light blue pivot point closer or further to the green pivot point and sets the locking point for a specific position of the jaws.