In case you didn't know, Dungeons and Dragons (commonly referred to as D&D or DnD) is a Fantasy Tabletop Roleplaying Game which was first published in 1974.
Although it's gone through a fair few rule changes over the years, the core premise has remained the same - a group of players create characters, form a party, and explore the world set out by the Dungeon Master (DM).
The DM basically acts as the game designer and the game engine, describing the world to the players, processing their actions, playing the role of any non-player characters they might meet, and running any combat encounters that might occur.