A: Nine months
Studies have found that infants as young as 9 months are able to understand friendship. Babies learn through observation and keep track of what is going on in the world around them.
They make inferences about social behavior and interaction as a result of these observations. The formation of reasoning based on mutual likes and dislikes extends back to infancy.
Studies imply that babies recognize that adults who agree with each other tend to act in a friendly manner in other contexts as well.