Amir and Hassan have a deeply complicated and tragic relationship. In all honesty, it's very hard to characterize it as a "friendship" past a certain moment in time, and that point is far before the horrific day that ultimately breaks everything.
Kids aren't born into the world with prejudices. They pick them up from their parents, their friends, the society around them, and so on. It seems to have been the same way with Amir and Hassan—when they were young and more or less in the dark about all the things that would become problems later, they genuinely were friends and liked each other. The moment things truly went awry was when both boys started to become aware of the fact that the world didn't think the two of them were as similar as they thought. Amir was a Pashtun, the son of a wealthy man, and Hassan was a Hazara. Both he and his father were servants of Amir's family. Now, it's probably unlikely that there was a time when they didn't know there was a social class between them, but it wasn't initially as big of an issue as it was later.
As the boys both start realizing how the world around them worked, the relationship between them changes completely. Amir starts feeling pressure not to develop a close friendship with a Hazara, and Hassan feels that he should keep in his own place and be more of a squire than a friend to Amir. The difference between the two comes from how they handled that situation; this also provides the answer to the question of Amir's resentment.
In addition to coming from different backgrounds, the boys are actually not that alike as people, either. Hassan has a good heart and a strong sense of loyalty, while Amir proves to be a cowardly, petty person. Amir dislikes the fact that Hassan is actually better than him—as a person and as a kite runner—but he is also painfully aware of how true it is. In a situation like that, a person can go two ways: they can try to be better, or they can try to make the other person worse. Amir keeps testing Hassan, becoming mean toward him, but Hassan remains who he is. That only infuriates Amir further and feeds the bitterness in his heart. Amir's father's affection toward Hassan only adds to that.
After the kite tournament, where Amir witnesses Hassan getting raped by some bullies and doesn't intervene (because of his own fear), the friendship between them is utterly lost. Hassan figures out that Amir saw and didn't help him, but he can't confront Amir about this. Instead, he becomes even more silent and reserved than before, heartbroken to find out that Amir wasn't a good friend to him when he needed him the most. Amir, in turn, starts to resent Hassan even more because of how badly he hates himself for letting it happen. This leads to Amir sinking even further, falsely accusing Hassan of a robbery and letting his friend take the blame.
The rest of the story concerns Amir's guilt and, ultimately, his attempts to make up for it, but even then the reader can see how his childhood fears hold him back from doing the right thing for Hassan's son for a long time. The Kite Runner is a powerful story of how artificial constructs like prejudice and class ruin people, how children carry their scars for the rest of their lives. The novel doesn't inspire much sympathy toward Amir, who could be called an anti-hero, but the truth is that he was born into an unjust and uncaring environment. He could have made different choices, could have stood up for Hassan, but we can't know if things would have been easier for them for it.