To understand the novel, you need to know the history of the Hazara people and the Pashtun people. They share a long history with each other. You want to know why? Well, it goes like this.
The Hazara seem to have a link to the Mongols, meaning that they might be the descendants of the Hazaras. The reason why Hazara are discriminated against is because of what the Mongols did to the Pashtun people. What did they do you ask? They invaded Afghanistan and claimed it as a part of their empire. Many of Afghanistan's people and other counties that were invaded by the Mongols hold a grudge against them for what they did, and think of the Mongol period as a dark, tragic period for their people. Another reason why they are pretty much hated is because of their Shiite faith. They are linked with their next door neighbors, the Shiite Iranians, an enemy of the Sunni Pashtuns.
You see Hassan, Amir's friend, and his "father" (I don't know what else to call him, cuz he's not really the father of Hassan) being discriminated against because they are Hazaras. You also see why they are treated as slaves to the Pashtun people.
Knowing this should bring you a greater understanding of why the characters in The Kite Runner, such as Assef treat Hassan in an unfavorable way.