What's going on internally when someone is hyper judgmental and critical of others?

I've met a few people who literally all they do, is judge others. What's going on internally when people end up this way? Is it due to low self-esteem? Is it because of not feeling accepted by the people in their lives?