Monsters in Crawl have one of four dispositions towards the player: hostile, neutral, peaceful, or allied. A brief description of each follows:
Hostile monsters will actively pursue the player and try to kill him/her, be it through spells, abilities, melee, ranged weapons, or other means. Individual monsters may have particular ways of behaving that override parts of this, but the general pattern remains the same: hostile monsters are trying to kill you. Even monsters with no means of attacking the player are considered hostile - one can see this by worshiping Elyvilon, who forbids attacking non-hostile monsters. Hostile monsters will not generally attack each other, although monsters will destroy plants in an attempt to reach the player, and some monsters are rather indiscriminate with multiple-target spells.
By default, every monster in the game is hostile. There are a few vaults that contain monsters of other dispositions, such as some Elyvilon altar vaults. Additionally, the player has a number of divine and magical means available to make hostile monsters neutral, peaceful, or allied.
Neutral or indifferent monsters are those with no particular desire to kill the player. They will not pursue, and will not use ranged attacks. However, they will still attack in melee anything that gets in their way: the player, other monsters, plants, etc. Attempting to move onto a neutral monster's square will attack it, possibly stabbing it and definitely turning it hostile. The game will not ask you for confirmation before doing this, unless attacking non-hostile monsters is forbidden by your god.
Neutral monsters are most commonly seen by Elyvilon worshipers. A neutral monster is the result of pacification; said neutral monsters will attempt to find the nearest staircase and leave the level, so there is no risk of neutral monsters accumulating from overzealous pacification. Monsters produced by Lugonu's Corruption ability will also be neutral (and easily provoked, since Lugonu doesn't care about you attacking them). In addition, there are a few vaults that contain neutral monsters, although these are quite rare.
Peaceful monsters are friendly toward the player, but are not allies. They will not attack the player, and attempting to move onto their square simply displaces them. One can still force-attack them or hit them with ranged attacks, although the game will ask for confirmation. Peaceful monsters will roam around, attempting to kill hostile monsters, using all their abilities in doing so. They cannot be given commands to attack a specific monster, and will not follow the player.
Peaceful monsters are found in a number of ways. Some are generated in vaults, such as the aforementioned Elyvilon vaults. Upon killing Pikel or Kirke, their companions will turn peaceful. Lastly, worshipers of the good gods will find that if their piety is high enough, holy beings will turn peaceful on sight.
Allied monsters are most akin to "pets" in other roguelikes. They will follow the player, attacking his or her enemies at will. They do not have much regard for their own safety in this endeavor: it is not at all uncommon to see an allied orc charging headlong into a two-headed ogre, with predictable results. They can be given a few simple commands: "Wait here!", "Follow me!", "Attack [a specific target]!", and "Stop attacking." Sadly, it is not possible to give commands to a single ally; you give them to all or none. Numerous gods forbid the attacking of allies, or at least of specific kinds of allies.
Allies are the second most common type of monster, after hostiles. They are never found naturally, but may be gained through a number of means. Beogh worshipers will find orcs turning allied on sight, and may receive permanent allies as gifts. Yredelemnul may gift permanent undead servants, ranging from wights to bone dragons. Summoned monsters, from a variety of magical and divine sources, are usually allied, although sometimes they can be hostile. Casting Enslavement on a monster temporarily turns it allied. Lastly, animating remains through Necromancy produces allied monsters, although only abominations can use stairs.