Mandolins evolved as part of the Lute family in Italy during the 17th -18th centuries, and the deep bowled mandolin produced particularly in Naples became a common type in the 19th century. The original instrument was the mandola ( mandorla is almond in Italian and describes the instrument body shape) and evolved in the 15th century from the Lute.
A later, smaller mandola was developed and became known as a mandolina which became the mandolin.
Further back, between 15,000 - 8,000 BC, single stringed instruments have been seen in cave paintings. They were bowed, struck and plucked. From these, the families of instruments developed that we know today. Single strings were long and gave a single melody line. To shorten the scale length, other strings were added with a different tension so one string took over where another left off. The earliest instrument to do this was the Lyre which was both bowed and plucked. The multiple strings gave them the capability of playing chords.
The bowed family became the rabob, rebec and then the fiddle becoming the violin and modern family by 1520 (incidentally also in Naples). The plucked family led from the Lyre to lute-like instruments, and developed into the Oud or Ud (Al Oud - the wood in Arabic) appearing in Spain in 711 when the Moors arrived in Europe.
Over the next centuries, frets were added and the strings doubled to courses leading to the first true Lute appearing in the 13th Century. The history of the Lute and the Mandolin are intertwined from this point. The Lute gained a 5th course by the 15th century, a 6th a century later and up to 13 courses in its heyday.
As early as the 14th century a miniature Lute or Mandora appeared. Similar to the mandola, it had counterparts in Arab countries (Dambura) and Assyria (Pandura). From this, the Mandolino (a small gut strung Mandola with 6 strings tuned g b e' a' d'' g'' sometimes called the Baroque Mandolin and played with a quill, wooden plectrum or finger-style) was developed in several places in Italy but seems to have became known as the Mandolin in early 18th century (around 1735) Naples. The 'modern' often termed Neapolitan mandolin (bowl-back, "tater bug", 4 course paired metal strings) appeared about 100 years later in around 1830.
The style was adopted and developed by others, notably in Rome giving two distinct but similar types of mandolin - Neapolitan and Roman. many of the best players chose the Roman made mandolins. The development of the Mandolino in Rome seems to have followed a slightly different course from that in Naples with many innovations of the Mandolina and later the Mandolin.
Classic 'modern' mandolins were made by the Vinaccia family (mid-1700s onwards) in direct continuance from their mandolinos, and by Calace (1863 - onwards) in Naples and Luigi Embergher (1856 - 1943), the Ferrari family (1716 - onwards also originally mandolino makers) and De Santi (1834 - 1916) in Rome. It is widely accepted that the evolution of the mandolin to the modern style is attributed to the Vinaccia family.
Mandolins became very popular and many lower grades were produced so that tourists (on the Grand Tour) could take home a mandolin. Often these were only fit to hang on walls as souvenirs and were brought back in their thousands. Some are playable but none match the workmanship and playability of the great makers.
The 20th century saw the rise in popularity of the mandolin for celtic, bluegrass, jazz and classical styles. Much of the development of the mandolin from neapolitan bowl back to the flat back style is thanks to Orville Gibson (1856 - 1918) and Lloyd Loar, the chief designer for the Gibson Mandolin-Guitar Manufacturing Co Ltd.