These words come from the Sermon on the Mount by Jesus as recorded by the gospel of Matthew and Luke. The whole statement is: "Blessed are those who mourn for they shall be comforted." In other words, in view of the comfort of God, there is blessedness. This presupposes two things.
First, there is much to mourn over. As you want to tie this to justice, we can say that there is injustice in our world. When we see injustice, there will be mourning. Justice will try to reverse the cause of mourning. This is the proper response. Since you want a picture, think of a hungry child, oppressed people in North Korea, refugees who lose everything, corporate greed and those who are paying for it through poverty.
Second, there is one who can bring comfort. According to the New Testament, Jesus can bring comfort, because he suffered, died and rose again. In other words, he know what people are going through and can help. Moreover, he will come to bring justice. He is according to the New Testament a just judge and king.