How is it that RMS is used to describe both audio output and mains power?
The short answer is that both amplifier output and 240V AC swing rapidly between a positive and negative voltage, and can be depicted as waves. RMS stands for ‘root mean square’, and the multimeters that calculate this provide the most accurate way to estimate continuous voltage.
It's calculated by taking a number of instantaneous voltage samples along the positive and negative curve of a wave form, such as AC mains power. The value of each sample is squared, then the values are added together and divided by the number of samples to give the average (or mean). The square root of this number is the RMS value.
In practice, the resulting parameter should produce the same heating effect in a resistor as continuous DC power at that voltage.
Why not just take the average?
Since taking the average of a wave that fluctuates between positive and negative voltages would give you a result of zero, only the positive half of the wave is considered. Taking an average involves calculating the area beneath a regular sinusoidal (or triangular) wave, and there is no problem with this in principle. However, as soon as you start looking at more irregular waves with peak values that vary unpredictably over time, the average will no longer provide an accurate indication of equivalent continuous power.
Why is this used for audio?
The RMS rating is a good indication of the continuous power that can be supplied by an amplifier to drive a speaker. Although an amplifier might be capable of delivering momentary peaks of sound at a much higher level, the overall volume perceived by human ears more closely, corresponds to the RMS value.