Uther was in love with Igraine and made a deal with Merlin. He would help Uther to conquer her and the child born from their union should be given to Merlin. And then Arthur was born.
Merlin became Arthur’s tutor while he grew up as his adoptive son. At a moment in Arthur’s career, Merlin organized a competition which had a sword stuck on a rock, and by winning the competition Arthur became king. After helping him become king, Merlin became close to Arthur’s half sister, Morgana.
He was completely in love and couldn’t see her bad side. That way he agreed to teach her all his mystical powers. Morgana ended up becoming more powerful than him. She said she wouldn’t be enslaved by him, and locked him up. That was the reason Merlin didn't go to Camlann’s battle and that is why Arthur died on this fight. After all Merlin was still in love with Morgana and died at the cave he was locked.