Actually we don't have definite answers to this question as there are so many theories . Some people find it as an emotional outburst of life events others say that it is the way of communicating before the birth of languages.
Whatever may be the reason, whether the release of toxins, the killing of bacteria or relieving feeling inside us, crying makes us feel good. When we have bad mood and upset mind we should heal ourselves by a good cry. After the tear shedding, the feeling inside us will be same as the feeling we usually have after a vomit.
Strong emotions like sadness, loneliness, fear, anger, anxiety makes trigger the brain to produce tears. Researchers found out that similar to urinating, sweating, exhaling toxins are excreted from our body through our shedding of tears. Several chemicals like endorphins, protein prolactin, enkephalin etc are there in our tears which can reduce pains. So crying may be the natural pain killers. In the whole universe, only we human beings can cry. So don't hesitate to shed some tears and make your mind and body pain less.