Often in movies and books, mail armour in the medieval period is portrayed to offer minimal to no protection. It seems that, when fighting a knight, the main objective is only to get around the plate armour. A well aimed arrow or thrust that finds an opening in a knight's plate armour always penetrates his mail tunic.
If mail armour offers so little protection, why wear it?
Because it actually offered great protection? Mail armor was cheap to build and repair and pretty effective. It was particularly good against slashes and offered an okey protection against piercing damages if you couple it with some leather tunic. More importantly it did not really hinder his wearer's movements which is pretty good in any situation.
Plate is better of course, but it is much more expensive, is harder to maintain (you need a blacksmith and his forge to repair it basically, while you only need some metallic wire to field repair your mail armor) and is of course much heavier, not as heavier as one would generally think as you could actually run and fight in it pretty well with a bit of training but still heavier than mail and much less practical and easy to put on in a hurry if your camp is attacked by surprise for example.
That is actually why Roman legions never really succeeded in deciding between the Segmentata (plate) armor and Hamata (mail) armor. Both had their drawbacks and advantages but all in all mail was generally regarded as much more practical to travel and easier to maintain without much infrastructures.