Fan service (ファンサービス fan sābisu?), fanservice, or service cut (サービスカット sābisu katto?), is a term originating from anime and manga fandom for material in a series which is intentionally added to please the audience. It is about "servicing" the fan - giving the fans "exactly what they want". Fan service usually refers to "gratuitous titillation", but can also refer to intertextual references to other series - Wikipedia
That just about describes fan service... and to answer your question
Keith Russell regards the beginning of fan service as taking place in a permissive context, when "kids were just doing kids' stuff", which he believes allowed authors some latitude in regards to their subject matter.
Beginning in the 1970s with Cutey Honey, and continuing later with other magical girl shows, fan service became more risqué. By the 1980s full frontal nudity and shower scenes became standard content for fan service. Later, Hideaki Anno who had promised Neon Genesis Evangelion would give "every episode...something for the fans to drool over" began removing the fan service imagery in later episodes. Those later episodes that did contain fan service elements juxtaposed them with imagery of the character in some kind of emotional trauma. Since then, fan service rarely contains full nudity.
Excessive content is now usually considered gratuitous regardless of its justification in relation to the narrative in which it takes place.
To expand -
Origination of Fan Service
a/o 26 September 2003...
The term "fan service" goes back to the late 80's at minimum. However, Dirty Pair was done in 1985 and clearly had fan service in mind even if they didn't expressly use the term then. The term "Gainax Bounce" has been described as fan service since their title Top wo Nerae! came out in 1988 (1). Gainax's anime parody of their own rise called 1982 Otaku no Video and 1985 Otaku no Video refers to fan service (2).
The first use of "fan service" on Usenet as refering to its current meaning was in 1994 by Hitoshi Doi (3). The actual first use of the term "fan service" on Usenet was done in 1991 by Tonghyun Kim and has a different context (3). (emphasis added by me)
By the time Gainax released Shin Seiki Evangelion in 1995, the term "fan service" was well known. This explains why on the previews for the next episode, Misato often called for more "service" or promised more "service". - source