An excerpt from my all grain primer:
The first thing I want to do is get the general concept understood. Efficiency is the ratio of how much sugar the grain has available to how much sugar you ultimately extract. Efficiency is literally "bang for your buck". Why should you care what your efficiency is anyway?
An analogy I like to use is making tomato sauce using canned tomato paste. Let's say a given recipe calls for 50 ounces of tomato paste and they come in 10oz cans. A high efficiency would be like emptying five cans completely. A poor efficiency is like leaving a lot of paste sticking to the sides of the can to the point where you have to open a sixth can in order to get 50 ounces total. Basically, poor efficiency means you get a lower gravity for a given amount of grain used. Again, bang for your buck.
It's important to note that efficiency is really an effect, not a cause (or choice). However, You can measure what your efficiency WAS on a given batch and it can ultimately become predictable if you keep your process consistent. You can also do things to your process to increase it.
The answer to the question begins with first knowing just how much potential sugar the grain has to offer. It does vary from one variety to another and even from one crop to the next. This isn't that tough for a brewer to figure out though because these figures are well published.
Once you know how much it has to offer, your brewing process will affect just how much of it you can extract. There are different points in the brewing process for which efficiency can be measured; Mash, Lauter/Sparge, and Brewhouse.
Mash Efficiency - How much of the available sugar was actually converted from the starch during the mash. This says nothing of your ability to separate that sugar during lautering/sparging. It is difficult to measure this and can be basically ignored if you're sure you've gotten good conversion (starch test).
Lauter/Sparge Efficiency - Assuming you converted all the starch to sugar, this is how much of the available sugars you were able to collect during the lauter/sparge function. Using a separation and sparge method that rinses "best" will yield higher efficiency. This value is easily measured by noting how much wort you've collected pre-boil (volume) and measuring its specific gravity (using a hydrometer or refractometer). These numbers will be compared against the theoretical maximum gravity.. More later.
Brew House Efficiency - This measurement/figure takes into account your entire process and is the most indicative of how much your wort "costs". The volume/gravity measurements are taken post boil, or most accurately in the fermenter itself. This number will be lower the previous efficiency measurement because it takes into account any wort you may have lost in your tubing, absorbed into hop sludge, or spilled between the MLT and Kettle or the Kettle and fermenter.