According to the Brittanica.com: "Merlin first appears in extant records (Armes Prydein, Y Gododdin) from the early 10th century as a mere prophet, but his role gradually evolved into that of magician, prophet and advisor, active in all phases of the administration of King Arthur's kingdom. He was apparently given the name Emrys (or Ambrosius) at his birth in Caer-Fyrddin (Carmarthen). He only later became known as Merlin, a Latinized version of the Welsh word, Myrddin, taken from the place of his birth."(1)
Merlin has as almost many interpretations as there are Arthurian legends. My favorite one is the "Crystal Cave" series by Mary Stewart. Merlin is the central figure in the early books (there are 4), until Arthur grows up.
According an article in Wikipedia on Geoffrey of Monmouth: "It was Geoffrey of Monmouth who introduced Merlin into the myths of King Arthur. The name Myrddin is altered to Merlin to avoid a resemblance to the obscene French word merde (meaning excrement, i.e., sh**). While Geoffrey is remembered most for his character of Arthur, it was Merlin whom he concentrated on, making the prophetic bard a central character of his three books: Prophetiae Merlini, Historiae Regum Britanniae and Vita Merlini. As a result of this second book, where Merlin appears in the tales of the king Vortigern, Aurelius Ambrosius and Uther Pendragon who reigned immediately before Arthur, Merlin in some later works also became a character in tales of Arthur." (2)
Before Monmouth's various versions, the Welsh historian Nennius, referred to Merlin as Emrys, a name later given in Stewart's book to Arthur himself 'til his true identity is revealed when he turns 14), or as the Roman "Ambrosius". (3)
Though his mother refused to reveal Merlins' father, he is said to be related to the half-Briton, half-Roman hero Maximus, who went to Rome itself and fought there. Some said Merlin was fathered by a Roman consul.
His rise to fame, according to both Nennius and Monmouth, came when Vortigern tried to build a castle that kept falling down. Priests told him to build it on the blood (sacrifice) of a "boy without a father". Merlin was brought forth, but had studied architecture and informed them they were building on top of a cavern with water. They found the cavern and inside were two dragons, a red and a white, who fought each other. The red dragon, said Merlin, represented the Britons and the white dragon the Saxons. Once the dragons were freed, the fort was built and Merlin spared. He went on to advise the son of Constantin, king of Britain, Uther Pendragon.
According to the same site (2) below, "Uther Pendragon was the youngest son of Constantine, and brother of Constans and Aurelius. Uther was the father of Arthur.
After his father died, his eldest brother, Constans, became the British king. However Constans' advisor, Vortigern, tricked some Pictish mercenaries into killing the young king. Vortigern seized the throne.
Fearing for Constantine's younger sons' lives, the foster-father send Aurelius and Uther to their relatives in Brittany, France.
Vortigern was a tyrant who allowed Saxons to live in Britain. Vortigern had married a daughter of Saxon chieftain named Hengest. Vortigern had the Saxons recruited into his army to repel the Picts from the north. The Britons did not like the Saxons, because more Saxons arrived every year from the Continent...War broke out between Saxons and Britons. Later, Vortigern's father-in-law, Hengest, treacherously overthrew Vortigern."
Depending on which story you read, Merlin either teamed up with or fought against Arthur's sisters (Morgause & Morgain [ "Morgan"] and The Lady of the Lake in Avalon) to become King of Britain, drive back the invading Saxons and preserve the old religion against the onslaught of Christianity.
He was a healer, whose symbol was the falcon and patron god Hermes (for swiftness and the air). He studied with the healer, Galen and often went about the country disguised as a doctor.
He helped Uther Pendragon have a tryst with Ygraine of Cornwall, married to Duke Gorlois, by using magic or just deception, in order to conceive Arthur. At Arthur's birth, he was then taken to be raised, first in Brittany, by a petty king Coel (the origin of the "old King Cole" rhyme?), then a knight/king in Britain, Ector, then by Merlin himself.
By all accounts, Merlin led Arthur to the "Sword in the Stone" (Excalibur), which he used in his first battle, helping Uther and thus being named heir. In one version, it is given to Arthur from the Lakee, by the Lady herself. In Stewart's and other versions, Arthur finds the sword in a stone and pull it out, after a contest, as the Sword endows it's owner with the title of High King.
On that fateful night, as Merlin had foreseen, Arthur was seduced by his half-sister, either Morgaine or Morgause (depending on the version), a union which haunted him morally and fatally, since it produced a son, Mordred, who killed Arthur in battle. Arthur was spirited away to be buried in Avalon. The legends say that one day, he will rise again to aid Britain in its hour of greatest need.
Merlin himself either "lives on", as some stories say, or was entombed by the sorceress Vivian ("Niniane") (the Lady of The Lake, in his own crystal cave, as she drained out all his knowledge of magic and psychic power. In Stewart's book, Niniane/Vivian, is just an apprentice, who masquerades as a boy, to learn Merlin's craft. He falls in love with the boy (!) and distressed, she finally reveals her true identity. They spend several happy years together, but eventually, she outstrips him in power and earns the trust (and in some tales, the love) of Arthur. It's debatable whether Merlin "gives" her the power to drain him or is trapped against his will.
Aside from the above books, the best-known stories are by Geoffrey of Monmouth and Chretien de Troyes (not the guy on Nip/Tuck!)...among others, including, later, Alfred Tennyson.