What is the purpose of so many gears?
There's a good article here which explains it pretty well - although there are 21 gears there are only effectively about 11 distinct useful gears on a typical 3x7 gear setup:



That is to say, some of the gear combinations overlap (or near enough) and this means you don't really get any extra function from them, but having them can make gear changing up/down a range smoother because it means you have to change the front sprocket less often. The exact number of "useful" gears will change based on the number of teeth you have in your particular setup, but the principle is the same.

As you can see from the graph, you do gain extra range from having an extra front sprocket - if you only had 28t on the front then adding a 38t gear gives you 3 extra useful gears, then adding a 48t gear gives you another 2 on top of that. This is good but it's not really the same as adding an extra 7 useful gears each time.

Also as some others have mentioned, gears don't always come in multiples of 7, this just seems to be the most common number of gears in the rear cassette of most mass-market bikes.