Type refers to a monster's species. Each monster has both a genus (generic group of monsters it fits into) and a species. Monsters with the same genus are represented by the same letter and are indistinguishable from each other when using Ashenzari's Detect Monsters.
Monsters in the same genus will make way for each other in order to surround you regardless of intelligence, and any monster with beneficial spells will generally only be able to cast them on other monsters of the same genus (meliai can only heal killer bees and queen bees, deep troll shamans can only cast Might and Haste on other trolls, orc knights' Battlecry only affects other orcs, etc.). There are some exceptions to this rule, such as ironbrand convokers.