I have been working on a new novel idea that include a number of different alien species, and I got to thinking about the roles that alien species tend to play in scifi. As I got to thinking about it, I realized that the same rules apply in fantasy to "races," such as orcs, elves, and so on. So really the examples that I'm talking about apply to any nonuman sentient species in fiction. But I'll stick with the word "alien" to keep it simple.
So here are the types I have thought of so far. Obviously, any alien/NS species can play more than one role in different circumstances. I'd be curious if anyone can think of others:
The Enemy Alien. These ones are simple. They want to kill you, eat you, lay their eggs in you, blow up your spaceship and steal your women. The only proper way to deal with them is to kill them first. This would include the original Klingons in the old Star Trek, the aliens in Alien and the bug things in Starship Troopers. In fantasy this would include orcs, trolls, demons and so on.
The Highly Advanced Alien. These aliens have achieved a level of technology that is as far beyond us as we are beyond guys hunting mammoths out of caves. Or sometimes as far beyond us as we are beyond ameobas. They can do things we can only dream of, of course, but when it's convenient to the plot they either share their technology/knowledge with us or we stumble across it by accident. A subset of this group would be the extinct Ancients, whose ruins contain mysteries untold. Extremely useful for authors who want to give their characters advanced tech without bothering to explain how it works. Examples of this would include the builders of the black monolith in 2001, or the Nasqueron Dwellers in Iain M. Banks' The Algebraist. In fantasy, the High Elves of Lord of the Rings might fall under this category, or the Eldren in Lies of Locke Lamora.
The Wise Alien. Often but not always highly advanced as well, these aliens are far more emotionally sophisticated than humans, and help us to develop past our character weaknesses and become better people. ET and Yoda both fall in this category. I can't think of an example in fantasy, but I'm sure I could if I put some time into it.
The "Character" Alien. These aliens exhibit a single characteristic of humans taken to an extreme. They are frequently amusing, and occasionally borderline racist. Like character actors, they tend not to be main characters in a story, but rather are aids or obstacles to the protagonist, adding "local color" to the story. An obvious example would be the greedy merchant Feringi in STNG, whose resemblance to stereotypes of Jewish people I can't believe no one has pointed out before. Ultra-logical Vulcans would be another example. In fantasy, you have the industrious but grumpy dwarves, the homely hobbits (though of course in LOTR they do become the protagonists), and the wild, horny centaurs.
The Just Like Us Alien. These aliens may have a different color skin, more or less limbs, and the ability to speak telepathically, but deep down inside they are just like us. Occasionally this is not obvious at first; they may appear to be Enemy Aliens until we get to understand them. Aside from a quirk or two, there is nothing in the way these aliens' character develops and advances that's any different from how a human's would, which is convenient for an author who doesn't want to figure out how a sentient mind could be different from ours. Most of the aliens on the Enterprise in Star Trek are like this. Enemy Mine is an example of an alien who is revealed to be Just Like Us. In fantasy any non-human sentient that's "part of the party" is usually like this, too.
The Incomprehensible Alien. These far-too-rarely used aliens are the complete opposite of the Just Like Us Alien. They are so unlike us we may at first have a difficult time recognizing they are intelligent, or even that they are forms of life. Though they are sentient, we can communicate with them about as easily as we can converse with an oak tree. They may be more or less advanced than us, but any "technology" that would be useful to them would be meaningless to us, and vice versa. It is my opinion that if we ever encounter alien life, it will be like this. The gods in Ken McLeod's Engines of Light trilogy are an excellent example of Incomprehensible Aliens. Though not completely incomprehensible, the bug aliens in Card's Enders' Game and the pig people in Xenocide are incomprehensible in a more minor sense. I can't think of an example of this in fantasy, but I'm sure it's been done.
As I said, I'm sure there are more kinds of aliens that I can't think of. Let me know in the comments if you think of any other examples.