Please explain the following quote from The Kite Runner, by Khaled Hosseini:
"We had both betrayed the people who would have given their lives for us. And with that came this realization: that Rahim Khan had summoned me here to atone not just for my sins but for Baba’s too."
Amir is the protagonist and narrator of The Kite RUnner, by Khaled Hosseini, and he tells the story of his life and his journey from shame, guilt, and betrayal to forgiveness. The opening line of the story sets the tone for the rest of the novel and the reason for Amir's journey:
I became what I am today at the age of twelve, on a frigid overcast day in the winter of 1975.
The story is a bit complicated, but the part that applies to the quote you mention is fairly simple--though the consequences of it are great. Amir's mother died when he was born, so he was raised by his father, a rather distant and unconnected man. Amir loved him and wanted more than anything to earn Baba's respect, but that was nearly an impossible task, though Bab always seemed to love Amir's friend Hassan unconditionally.
Baba imposed his views about life on his son, and one of his primary beliefs had to do with honesty. Baba said:
“When you kill a man, you steal a life. You steal his wife's right to a husband, rob his children of a father. When you tell a lie, you steal someone's right to the truth. When you cheat, you steal the right to fairness.”
Amir believed his father lived his life according to that philosophy, and Amir felt terrible whenever he failed to live up to it in his own life.
Two things happen which change the course of Amir's life, and neither of them has anything with Amir and Baba having to leave their country because of the war. No, these were two occurrences which did not need to happen but did.
One of them is Baba's lying by omission about having another son, Hassan, the boy who grew up as Amir's best friend. Hassan is devoted to Amir, even when Amir is cruel, unkind, or dismissive--which is often. Keeping that significant truth from Amir is the equivalent of Baba's breaking every moral code Amir had ever known, and it explains why Amir was always jealous of Hassan.
The other is the moment Amir refers to in that opening sentence. When Hassan is in the worst kind of trouble, being violently assaulted by a perverted bully, Amir sees what is happening but does nothing out of his mean-spirited, selfish jealousy about having to share Baba's love with Hassan. Hassan has been everything a brother should be, despite Amir's lack of knowledge about the true state of their relationship; Amir betrayed that trust and love.
Things get worse, and Amir is responsible for Hassan being sent away; eventually Amir works his way to the realization that Baba is just a human being who makes mistakes, not a god, and Hassan never tried to steal Baba's love from Amir. Rahim Khan, Baba's business partner and family friend, calls Amir one day, many years later, and offers Amir a chance to make up for his past mistakes, knowing everything that happened. Amir can go and rescue Hassan's son, which he finally decides to do.
In the process of doing that, Amir speaks the lines you mention:
We had both betrayed the people who would have given their lives for us. And with that came this realization: that Rahim Khan had summoned me here to atone not just for my sins but for Baba’s too.
As he does this difficult thing, Amir discovers the truth that just as he betrayed Hassan's trust, Baba betrayed Amir's trust. Just as Amir would have died out of love for his father, so Hassan would have died out of his love for Amir--and, in a manner of speaking, he did. By saving Hassan's son, Amir could atone for his own as well as his father's sins.