Soon after his birth the Prophet (S.A.W) took Ali (A.S.) under his care and his wife Khadija adopted him as her own son. Ali (A.S.) lived with them. He was fed, washed, dressed by the Prophet (S.A.W) himself. The Prophet (S.A.W) made him sleep in his own bed, and took him wherever he went.
(A.S.) describing his upbringing by the Prophet (S.A.W) says,
The constant company of the Prophet (S.A.W) gave Ali (A.S.) the opportunity to absorb all the attributes of the Prophet (S.A.W)s character in the matter of knowledge, self sacrifice, forbearance, bravery, kindness, generosity, oratory and eloquence. What others heard from the Prophet (S.A.W) he too heard but what he heard from the Prophet (S.A.W) when was alone with him, the others did not hear.
It is a well known fact that every tradition Ali (A.S.) narrated was that he heard from the Prophet (S.A.W) himself. When somebody questioned him as to why he is being preferred on others in the matter of knowledge and traditions, Ali (A.S.) replied, "The Prophet replied to what I asked and he told me what I did not ask". Speaking about the Prophet (S.A.W), Ali (A.S.) said, "He is the leader of all who exercise fear (of Allah) and light for them who seek guidance. He is a lamp, whose flame is burning, a meteor whose light is shining and flint whose spark is bright. His conduct is upright, his behaviour is guiding, his speech is decisive and his decision is just."