if I remember right It goes something like this:
There's this apparatus called a Seyboth Universal Viscometer. A certain amount of oil is heated to a certain temperature and then drips out of the apparatus, the number of seconds it takes to drip out is the viscosity, for example, 100 weight oil takes 100 seconds to drip out. SAE cuts the number in half. There are other ways to measure the viscosity in this day and age, I'm sure.
The W stands for "Winter" and "multi-grade" is kind of a lie. If you consider that a single grade oil (say, SAE50) becomes less viscous as temperature goes up then you could draw a curve showing this relationship. You could draw the same curve for a lighter weight single grade oil (say, SAE20).
In very simple terms, multi-grade oil is simply an oil where the curve begins at the high point of the lighter weight oil, and ends at the low point of the heavier weight oil.
so 20W50 has the viscosity characteristics of SAE 20 weight oil (Seyboth 40) at colder temperatures, and SAE50 weight oil (Seyboth 100) at higher temperatures.
Clear as crude?