Getting a Grip on Hammers and Pulls
by Christopher Sung
The hammer-on occurs when you pluck a particular note and then using another fretting finger, strike a note on the same string but located above it on the fretboard. The attack of the second note (i.e. the hammer-on") is more subtle since you aren't plucking it. This also allows your picking hand to do less work, since the work of the second note is being achieved solely by your fretting hand.
Measure 1 shows the basic hammer-on, and the subsequent measures show different variations of it. In general, you'll hear more of the hammered note on an electric guitar and even more if you're using distortion or compression. For acoustic guitars, it requires a bit more effort to really get it to ring..