I break it down in my all grain "primer" article and maybe it will make sense to you.
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 (Conversion) 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).
Mash + 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. Note for you beersmith users: this type of figure is also called "efficiency into the boiler".
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.
Calculating Efficiency by hand:
We already know that there are software packages and online calculators that will help you figure out your efficiency at various stages but its a good idea to understand where the numbers come from. I suggest you figure it out on paper (or with a calculator) at least once and compare it to what the software told you. In order to show you how, we'll work on a practical example. Let's say you're brewing a simple 5 gallon pale ale using 10 pounds of American 2-row malt, and 1 pound of Crystal 40L.
We'll look up the specs on these two malt types in the HBT WIKI to find out what their maximum sugar potential is. This is rated in Potential Gravity Points Per Pound Per Gallon (PGPPPG) or just PPG for short. I know, just hang in there
2-row is rated at 1.036 PPG or 36 gravity points per pound and 40L is rated at about 1.034 PPG. So the math:
Fig. 1
(Malt #1's PPG x actual pounds) + (Malt #2's PPG x actual pounds) + ETC = Total Available Sugar or Gravity Points.
(36ppg x 10pounds = 360) + (34ppg x 1pound = 34) = 394 gravity points available
Now that we know the maximum gravity for this grain bill, we have to actually measure the dilution. If you accurately measure the volume of wort you've collected, you will know what the maximum gravity would be. In this example let's say you collected 5 gallons into the fermenter.
Fig. 2
Gravity points available / Collected Volume in Gallons = Maximum Original Gravity
394 / 5 = 78.8 or an maximum SG of 1.079.
So with the above calculation, you've figured out that at 100% efficiency, your 5 gallons would measure 1.079 SG. Of course, no one ever gets ALL the sugar out. This is just a theoretical maximum. The last piece of the puzzle is to actually measure your SG/OG with a hydrometer or refractometer and compare (divide) that figure against the maximum. Let's say for example that you measured 1.065 OG:
Fig. 3
Measured Specific Gravity in Points / Maximum Specific Gravity in Points = Efficiency
65/79 = .82 or 82% efficiency
Note that you might see this calculated using a different order of operations. In the first calculation we figured out the total theoretical points for those grains at 394. You could have also figured out your actual total points by measuring your OG and multiplying that by how many gallons you had. That would be 65 x 5 = 325 total points. Now you use the percentage formula from figure #3 above (actual total points/max total points) or 325/394 = .82 or 82%. It's just two different ways to get the same number.