A quick definition of RPG: "D&D meets computer".
Role-playing games, or RPGs for short, are not originally computer games. Anyone born in the second half of the twentieth century may dimly recall something called Dungeons & Dragons. The first time I heard of Dungeons & Dragons was when an old school friend I was visiting picked up the phone and started a conversation about gods and alignments. Seeing the halo of question marks around my head after she hung up, she explained that a member of her D&D group needed a new character to play, and we fell into another conversation about lawful-neutral-chaotic, artifacts and divinities, and the time they'd had to kill off a character because he was getting too much into character, and consequently, being an Orc, harrassing an Elf member of the party. D&D is a board game. It consists of a circle of players, the Dungeon Master and a pair of dice. The players each assume a role based on a race of fantasy characters, and an appropriate alignment which will dictate their actions in the game, and acquire statistics or "stats" - health points, magic points, abilities - determined by the dice. Then, they set off on an imaginary quest which is not necessarily in a dungeon, but generally about collecting treasure, battling monsters, "levelling" (using experience points to attain a higher level, which raises the stats) and, last but not least, trying to survive. Although the whole adventure happens in their heads, they need a common point of reference, someone who tells them what they're supposed to be seeing: the Dungeon Master. The DM also knows all the things (like the properties of magical items) that the players, through trial and error, are trying to find out. The DM's knowledge is extensive, and the average player's knowledge quite considerable too: players have to know about the many types of weapons available, the geography of their terrain, and many other basic, easily forgotten things. As the friend and I concluded, D&D is an educational ongoing brainteaser; it may take place in an imaginary world, but that imaginary world is ruthlessly consistent. Say, you want to travel to village X. You'd better have enough food packed, or you'll be starved before you're halfway there. You'd better check the season, because if you travel too late in the year, the roads will be covered in snow. You'd better hope you didn't kill any locals, or the villagers will attack you when you show your face.
At the time, I was fanatically playing an RPG called Phantasie. Obviously, it didn't even touch the complexity of the board game. The real D&D, based on the works of Tolkien (a downer for me, as I hate Tolkien, but I love to picture him spinning in his grave at the omnipresence of orcs in adventuring parties) is, or possibly (through the advent of computer RPGs) was, a world unto itself, based on an amalgam of fantasy literature from Tolkien to Lovecraft, with its own lore and literature (in the form of guide books) that RPGs like to emulate, parody and refer to. And RPGs are little spin-offs from this world, with the game engine as Dungeon Master, emphasizing this aspect or that of D&D. RPGs may feature a single character, or a main character picking members to join, or just members, none of them the main player; all different ways in which the game bridges the difference between a group of players at the table and the lone adventurer behind the keyboard.
Old RPGs were simple with very little graphics, bare frameworks supporting the player's imagination (as in the real D&D), new ones attempt more and more realism (demanding more and more of the graphics card) in an effort to give the imaginary world a tangible existence. Some RPGs play exclusively in a dungeon (the place where treasure is found, and unlimited killing permitted), others are mostly above-ground and make more use of quests. Stock ingredients are a choice of race and/or class, different grades of weapons and armour, and levelling up, although not every game does as much about levels. But, through gaining levels or otherwise - and this is the essential difference between an RPG and a fantasy adventure, similar though they may look - the player(s) is/are supposed to improve over time. RPGs, despite their fantasy setting, are highly cerebral and, in their own context, coldly logical (if you lose both arms, you can't cast magic) and tend to have turn-based combat where the results of each action are reported in detail, so as to properly plan the next action. In violation of this principle, newer RPGs are fashionably "real-time", which means hammering away at the keyboard and only assessing the damage after the fight is over, so the focus shifts to pre-fight planning. Since an RPG character has to convert the loot into money to get by, the second most important activity after fighting is trading, and every RPG I know has shops and traders, in the dungeon itself if need be. The shift from D&D party to lone player has taken another direction with multiplayer options and specifically multiplayer online worlds like Everquest, which I've avoided due to both the phenomenon "lag" and the predictably annoying behaviour of other players, who will actually hang around begging others for money (a colleague and online gamer told me of a gnome character whining to other players for "one gold") when they're not being otherwise obnoxious. The good thing is, you can legally kill them.
Commercial RPGs used to be like commercial computer games as they first came out: buy game, play game, finish game, toss game, buy new game. But RPGs, even more than text adventures, have a "nerd" background, and nerds don't always go for commercial games. RPGs can resemble text adventures in that you have time to process the information and think about the next move. In their aspect of trade and self-improvement - some even allow a form of "farming" to supplement the income from treasure-hunting - they resemble sims. And since sims are by nature open-ended, and RPGs, unlike adventures, don't have a fixed ending (well, when all the treasure is looted and all the monsters are killed, maybe?) it wasn't long until the first open-ended RPGs came out, that is, RPGs to which, once the standard content was exhausted, players could add new self-made content; which the players, being generally computer nerds, had no trouble doing. Although RPG content in its purest form is easy to make: treasure, monsters, setting, off you go.
I am not a "pure" RPG player. In no RPG I've enjoyed have the real elements of RPG ever interested me. The fine art of levelling bores me, I've no desire to kill anything (as opposed to "hack&slash" type players who chiefly want to pile up the bodies), quests are only done if I'm asked nicely and loot, well, it pays for swords. What attracts me in RPGs is that they are fantasy, yet require a certain amount of intelligence and deductive powers; they contain shiny things and exotic beasties; they are set in a time before coalmines and digital watches; and in their levelling or other form of self-improvement, they allow the player some control over the game. Like sims, they are a private virtual playground, a place where fantasies can be indulged in, and destinies built. And so, like sims, they can be highly addictive.
Because real-reality is for people who can't afford a computer.