An average is a set of consecutive solves, in which 5% of the best and 5% of the worst times are removed. (If the resulting number is not an integer, it is rounded up. For example, in an Ao5 only the best solve and the worst solve are removed because 5 * 5% rounded up gives one). The remaining 90% of the times are then averaged together. Most events use averages of 5. There are a few exceptions however, generally events which take longer, using means of 3.
In an AoX, the removed times in an average are placed in brackets. Example: (5.43) 4.32 3.21 2.10 (1.00)
Types of Averages
Average of X (AX, AoX)
Most speedcubers use averages of 12 to gauge their ability, because most view that averages of 5 contain too much luck. Averages of 100 can also be useful in determining consistency in puzzles such as the 2x2 and magic, where virtually all mistakes count towards the average.
A rolling average is when you do an average, then continue to do solves. The first solves are then removed from the average and replaced with the newer ones. For example, if you did an average of 5 with (15.32) 14.64 13.17 (11.22) 12.88, you can do another two solves to remove your two highest times and attempt to get faster times. The times that are removed are considered "rolled".
A global average could technically be calculated by - completely halting your improvement (as well as not getting worse) at your current point in your cubing progression, solve an infinite number of cubes, and take the average of all of them. Of course, times fluctuate from day to day, you never know if you're improving past a wall or not, or if its just a lucky day, etc. So global average is just taking a guess at what "infinite average" would be. A decent way is to figure this to graph out your best average of 1/5/12/100/1000, etc, and find a relatively accurate asymptote. Or you can just eyeball it. It usually won't be too much slower than your best average of 100.