Also sometimes people lie just for the sake of it. Some people also might have compulsive lying disorder, where they just have to lie. For the former, people might enjoy confusing the audience or instigating them to doubt their friend.
Example: Your best friend has said, "It's really not my fault! Sally is the one who ate the chocolate."(He is telling the truth) But the liar might say,"I remember seeing you eat the chocolate...You are such a liar, John!"(In this case, the liar is saying this to make you doubt or mistrust your friend)