The mate command (lower-case "m") causes your dwarf to mate with the nearest creature-- preferably one of the She-Dwarfs found in levels 20-23. Mating with a She-Dwarf will restore your health, remove all curses, and produce an offspring. If and when your current dwarf perishes, instead of creating a new set of grandparents via the game's Character Creation system, you will be given the option of playing as your offspring, who inherits some of your traits and some of hers. This is helpful in passing on high-level skills, such as Gorgon-Taming, to a starting character.
Mating with any other kind of creature will tip your karma unfavorably. Mating with a puppy (an easy mistake, given the similarities of the mating and puppy-breeding commands) will result in an instant smite.
Some players, intent on creating a better and less-random starting character through several generations of mating will intentionally woo and mate with each playthrough's Black Widow She-Dwarf instead of wandering around and waiting to die (because if they used the suicide command, it would negatively effect the luck of their offspring).