Right. So let's say as a hypothetical you are in S2 and going 40, the transmission is in 2nd engine will be racing and making a lot of noise. When you shift up to S3 the car will shift to 3rd, the engine will slow down and get a little quieter. Then shift to S4 and it will probably shift to 4th and the engine will slow down some more.
Now with the car still in S4 and going 40 you go to pass someone up a hill so you floor it, the transmission will go down to 2nd or 3rd and the engine will speed up. When you let off at the top of the hill at 55 the transmission will shift back up to 4.
Now shift to D and the transmission will probably go right to 5th or 6th or whatever the top gear is, since there is no load on the engine. This will make the engine quiet and efficient since it will be turning as slow as possible for the given road speed.
Now you are going down the long hill and want to slow down without riding the brakes and warping them. Shift to S5 or S4 or something and the engine braking will increase. The car is in deceleration fuel cut, so you aren't wasting gas, just making some noise but saving wear on the brakes. If you try to shift to S1 at 55, the computer will not allow this, since it would cause the engine to spin too fast and damage it.
I don't know if the gear/ speed combinations I wrote there are exactly right, but that's the concept. (Note that the use of S2 etc in the first two paragraphs is totally unnecessary, the car would've figured that all out on it's own, and done so more efficiently)