The number of sets has to do with the amount of training volume. Training volume is one of the variables you have to manipulate to induce adaptation, while avoiding over-training. There are different approaches to sets/reps which provide the training stress you need. The more you progress as a lifter the more you have to increase the total volume of training to adapt, but still allow for varied loads throughout a training cycle.
- Sets across: all work sets at the same weight. This is the approach that Stronglifts 5x5, Starting Strength, and Madcow Advanced volume phase use. 5 sets of 5 is a lot of volume, and while it is excessive to cause adaptation for beginners, it does allow for more practice. NOTE: SL 5x5 becomes 3x5 and then 1x5 as the weight gets heavier, which reduced the training volume to keep it in a range that helps you get stronger.
- Ramped sets: work sets increase in weight. Madcow 5x5 intermediate uses this approach. You really only have one heavy set of 5, but it is more volume than if you simply warmed up for a single set of 5. Madcow Advanced uses this approach in the intensity phase. Wendler 5/3/1 also uses this approach, with only 3 work sets.
Beginners can adapt with only three sets of work. The true purpose of the extra 2 sets on Strong Lifts is more practice while the weight is very light. SL promotes starting much lighter than you can lift. If you've never lifted before, you start at just the bar. If you have lifted before, you cut your current work weights in half.
Intermediate Lifters can adapt weekly. However, the work volume needs to be varied throughout the week to enable new personal records (PRs). For example, Madcow Intermediate uses the first session as a volume phase doing 5x5 ramped sets. The second session has 4x5 ramped sets (on squats it's sets across for the top two sets) which allow for more recovery. On the last session of the week, you have 4x5 ramped sets, a top set of 3, and a backoff set of 8 for each of the main lifts.
Advanced Lifters can adapt monthly. The work is usually varied throughout the weeks so that you have a volume phase, a transition phase, and an intensity phase. The volume phase primes the pump and really forces the adaptation. The transition phase is a bit of reduced volume to allow mid-cycle recovery. Finally, the intensity phase is where you set new PRs.
The closer you get to your genetic potential (i.e. the more advanced you become), the finer the line is between training volume to induce change and the volume that induces over-training. That's why you have to pay attention to the overall training volume, other life stressors, and your mood.