I had a quick search for some information about it.
Apparently because frogs breath (to a certain extent) and drink through there skin so they need to shed it quite regularly. It also helps to get rid of extenal parasites. It also said that they eat it afterwards.
Some other interesting stuff i found was that..
Some frogs skin changes colour to regulate heat absorption. (Which is cool cus I noticed mine have got alot lighter in coulor and was wondering why.)
And that, in dry environments, some frog have been known to retain their skin as a cocoon to keep in water so they dont dry out.
This is the link: http://www.thefrog.org/biology/skin/skin.htm