I'd reckon a lot of it is simply technique and experience built through rolling.
However, I would say that the motion of having someone in your guard would use more hamstring (back of the thigh) than quadricep (front of the thigh), since you're "pulling" them in with your legs. So if you're really looking for some strength training ideas to help you in that position, I'd definitely look towards strengthening the hamstrings.
Heavy deadlifts are always good, and basically one of the best hamstring/strength training movements. Beyond good ol' deadlifts, you can look at things like glute-ham raises, leg curls, good mornings, or power cleans.
It doesn't hurt to also strengthen the quadricep though, especially since you also use the opposing muscle to some degree when doing a heavy compound lift. So by squatting and doing lunges, you're still working the hamstring at least a very little bit.
I guess simply put, you want stronger legs, then strengthen your legs. =P
Hope that helped a bit.