It was actually Baba's father, "a highly regarded judge," who took in Ali as a young boy. Ali's parents had been killed, and the judge--Amir's grandfather--"adopted him into his own household." Ali was given special treatment from the start, and the other servants were ordered to "tutor him, but to be kind to him." Baba and Ali were about the same age, and they became "playmates"; but, as Amir points out, Baba never did "refer to Ali as his friend." Ali was both a servant and Hazara, and though Baba probably loved Ali, the two men were on the far ends of the Afghan social ladder. Baba was tolerant of all Hazaras, but he was also Ali's employer, so there remained a distance between the two men. Ali was still able to perform his duties even after polio had crippled him, and Baba showed his own loyalty, if not love, for Ali by keeping him around well into adulthood. Baba considered his own home Ali's home.
"I grew up with Ali... My father took him in, loved Ali like his own son. Forty years." (Chapter 8)
And like his own father, Baba is prepared to also love Ali's son, Hassan, in much the same manner--but for a far different reason.