To take a child that lacks parentage lnd raise it up like a son or daughter catering for their physical, educative and spiritual needs is a great charity in Islam. The prophet himself was orphaned while a child, and was raised by his grand father Abdul Muttalib and then by his uncle Abu Talib.
The way of adoption as practised in the West, however, is not the Islamic way. It usually entails the lie of registering the child as your own, and such lie is not permitted, whether given to the child or finding its way to official documents.
In pre-Islamic days, the Arabs used to practise adoption the same way as the contemporary West. They gave their name to the adopted child. When the adoptive father died the adopted child inherited like a real child. When the adopted son got married, his wife was considered daughter in law, and if divorced she was forbidden to his father to marry.
The prophet himself had an adopted son called Zayd. His father was called Haritha, but because of the adoption he was called Zayd ibn (son of) Mohammad. Zayd had been a slave but the prophet saw to his freedom. He lived in the prophet's household and loved the prophet so much that when his father Haritha, wanted to take him, he chose to stay in the company of the prophet, so the prophet adopted him. Out of love and appreciation, the prophet saw to his marriage to Zainab bint Jahsh, the prophet's own cousin. Later on, this form of adoption became forbidden. Quranic revelation carried the new legislation:
The Quran referred to Mohammad in person concerning this issue:
"Mohammad is not the father of any of your men, but (he is) the apostle of God and the seal of the prophets, and God has full knowledge of all things." (33:40)
From that time on Zayd was again called Zayd ibn Haritha and not ibn Mohammad. It so happened that Zayd and Zainab did not turn out to be a happy family. The prophet felt sad for to him Zayd was like a son, and the idea of the marriage was his. Repeatedly he would tell the impatient Zayd to keep his wife and not divorce her. But God had other plans, for He wanted to reinforce the cancellation of that form of adoption by making Mohammad marry Zainab after her divorce, so that other adopting fathers would not be embarrassed if they wanted to marry the divorcee of their adopted son, making Mohammad the first example thereof; and He let Mohammad know it:
"It is not fitting for a believer, man or woman, when a matter has been decided by God and His apostle, to have any option about their decision. If anyone disobeys God and His apostle, he is indeed on a clearly wrong path. Behold! You (Mohammad) do say to the one who received the grace of God and your favour: retain your wife (in wedlock) and fear God. You do hide in your heart that which God is about to make manifest. You did fear people but it is more fitting that you should fear God. Then when Zayd has dissolved (his marriage) with her, with the necessary formality, We joined her in marriage to you, in order that (in future) there may be no difficulty to the believers in (the matter of) marriage with the wives of their adopted sons when the latter have dissolved with the necessary (formality) (their marriage) with them. And God's command must be fulfilled." (33:36-37)
Some orientalists who are adversive to Islam tried to exploit the event in a slanderous way trying to accuse the prophet-peace and prayer be upon him of being behind the divorce as he had been behind the marriage, because he wanted to marry Zainab. Anyone who studied the character of the prophet is well sure that such allegations cannot be true. Besides, Zainab was his cousin, he knew her well, and he could have had married her in the first instance had it been his wish.
The new legislation did not in the least undermine the relation between adopted son and parent. The inheritance laws apply and only the legitimate blood relations inherit, but Islam permits the muslim to give out of his legacy to whom or whatever he wishes, within a ceiling of one third of his possessions. It is up to the adoptive parents then to relegate what they see fit to the adoptee within that limit.
As the adopted child grows up, the women in the household including mother and daughters should follow the Islamic code of social conduct regarding dress and intimacy. Unless he was breast fed by the mother (lactation fosterage), he can marry one of the daughters.
The links of love and appreciation between Mohammad and Zayd remained as close as they ever had been. Mohammad chose Zayd's son to lead an army but Mohammad died before. Aisha, the prophet's wife, once said: had Zayd been alive, the prophet would probably have selected him as his successor as caliph.