The main things happening within the muscle that effect rest periods are ATP/CP replenishment, and the repayment of an oxygen deficit.
During most resistence training, your body is going to use ATP/CP as an energy source. This source is quickly exhausted however, and when it runs out motor units will lose their ability to fire and your force production will go down.
Secondly, when using the anaerobic glycolytic system, once the muscle has run out of pyruvic acid to accept hydrogen ions, the cell will begin to lose function. This is what people incorrectly say is "lactic acid" burn. In fact lactic is simply pyruvic acid plus a hyrogen ion. It is when you run out of pyruvic acid, so no more can be converted to lactic acid, when the problem begins. Hydrogen ions will having no place to go float around the cell, which becomes acidic and loses it's ability to function.
So for everyone here, lactic acid does not cause "the burn" nor does it cause soreness. It is simply pyruvic acid plus a hydrogen ion, which later gets removed and becomes pyruvic acid again.
Regarding ATP/CP phosphate recovery,
20-30 seconds will provide about 50% of ATP/CP recovery
40 seconds - 75%
60 seconds - 85-90%
3 minutes - close to 100%
Regarding lactic acid removal, depending on the athlete, lactic acid builds up at different rates for different people. In trained athletes the lactic acid is usually reconverted to pyruvic acid prettty quickly after a set, within one minute. For untrained people, this may not be the case. However, lactic acid will be removed from the muscle cell to allow it to function more efficiently within a short period of time. Once lactic acid is in the blood stream it has to go to the liver to be turned back into pyruvic acid. Depending on how much lactic acid has built up in the blood stream this can take up to an hour.
Athletes training for strength want maximum motor recruitment on every set so as to continue to train the muscle and nervous systems as they will be utilized in whichever event is being trained for.
Some parties suggest that in training for hypertrophy incomplete recovery is optimal so that the muscle will begin to recruit fibers other than the original fast twitch fibers that are already exhausted from the first set. That way a larger percentage of overall muscle fibers are activated. Other parties argue complete recovery should be as complete as possible. Usually 60-90 seconds is recommended for hypertrophy.
Some people suggest that the ATP/CP phosphate should be exhausted AND the lactate threshold should be reached during a set. So, according to that logic, when choosing your sets you should choose a weight that will cause you to fail when approaching 1 minute under load. So you can see rest periods are also going to be relative to how long the muscle was worked in the first place.
Of you are an athlete like an elite cyclist or runner you may be training for a higher lactate threshold. In that case you would want to flood the muscles with hydrogen ions by using maximal effort for close to a minute, followed by a complete recovery, then repeating several more times. You could also train at a heart rate close to your max, but not quite there for an extended period of time.
Hopefully that sheds some light on rest periods for you.