Rats are traditionally the lowest on the totem pole in terms of enemy strength - similar to the slimes in Dragon Quest, they're the weakest and easiest to kill and are usually the first enemies a player encounters in a role-playing game.
The concept of fighting rats and the notion that your character is so unskilled he or she can only kill tiny rodents is a bit insulting, however, and most newer RPGs skip the rat step. Sometimes it's even treated as a joke - for example, the first fighter's guild quest in The Elder Scrolls: Morrowind had you fighting rats, and the first fighter's guild quest in the sequel Oblivion had you protecting rats from mountain lions. Additionally, in Gears of War, one of the cutscenes in the first chapter opens with a boomer stepping on a rat as if inferring to the player that rats are not an enemy but more of a nuisance.
Sometimes it's handled as an homage - Final Fantasy XII has the first tiny quest involving killing rats in a sewer. Other games insert small animals in lieu of rats with the same end purpose. Asheron's Call's weakest enemies were bunnies, which populated many areas and were the primary source of experience for extremely low level characters as they posed little to no threat. In EverQuest, Human players are tasked to slay rats outside of Freeport to gain experience and treasure.
In some first person shooters there is sometimes rats, the rats are often inoffensive and run around to add some life and show the status of the place. Games like Deus Ex features rats that are killable, but they aren't enemies.
Some other games have hostile rats like in Blood or Sin. Those rats are easy to kill but the hard part it's the fact they are often fast moving targets and their size makes them hard to hit with a weapon.