There are different types of smokers, and each works a little differently. They all basically cook foods slowly and relatively low temperatures (175-275 degrees), and flavoring the food with smoke as it cooks. The low and slow cooking produces juicy tender meat.
Vertical smokers work by producing heat from burning charcoal or gas, of from an electric element. Smoke wood is placed on or near the heat source a few times to flavor the meat.
(edited- thanks) Horizontal (pit smokers) are designed with a firebox on one end. Charcoal can be used in the firebox, with smoke wood added occassionally to flavor the food. Traditionally a wood fire is burned in these to provide both the heat and the smoke.
Each type of smoker has its benefits, so it's really impossible to say which is the "best". It's all a matter of personal preferences and cooking styles.