Short answer
Islam treats a daughter as a blessing and a trust. In the Arabia where the Prophet (ﷺ) began, some fathers grieved when a girl was born. Some even buried baby girls alive. The Qur'an condemns that grief, calls the choice to bury her evil, and forbids killing children. It says that on the Day of Judgement the buried girl will be asked for what crime she was killed. The Prophet (ﷺ) said that whoever raises two girls well until they grow up will be close to him on that Day. Widows were once inherited by their dead husband's family, like property. The Qur'an forbade this and made the widow an heir to her husband's wealth.
Full explanation
The Arabia the Prophet (ﷺ) found
Before Islam, some Arabs killed their children, and baby girls were buried alive. Ibn Abbas was a cousin of the Prophet (ﷺ). To know the ignorance of the pagan Arabs, he said, read Surat al-An'am, the sixth chapter of the Qur'an, after verse 130. There the Qur'an says that those who killed their children out of folly are lost.
Ibn Abbas said that whoever wants to know the ignorance of the Arabs before Islam should read Surat al-An'am from verse 130 on, where the Qur'an condemns those who killed their children out of folly.
“Lost are those who slay their children, from folly, without knowledge, and forbid food which Allah hath provided for them, inventing (lies) against Allah. They have indeed gone astray and heeded no guidance.”
The Qur'an condemns the grief at a girl's birth
The Qur'an describes the father whose face darkens when he hears that a girl is born. He hides from people in shame. He wonders whether to keep her or bury her in the dust. The Qur'an calls that decision evil. It forbids killing children for fear of poverty, because God (﷾) provides for them and for their parents.
“When news is brought to one of them, of (the birth of) a female (child), his face darkens, and he is filled with inward grief! With shame does he hide himself from his people, because of the bad news he has had! Shall he retain it on (sufferance and) contempt, or bury it in the dust? Ah! what an evil (choice) they decide on?”
“Kill not your children for fear of want: We shall provide sustenance for them as well as for you. Verily the killing of them is a great sin.”
The buried girl will be asked
On the Day of Judgement, the Qur'an says, the girl who was buried alive will be asked for what crime she was killed. The question condemns her killer before all creation. The Prophet (ﷺ) listed burying daughters alive among the things Allah (﷾) has forbidden.
“When the female (infant), buried alive, is questioned - For what crime she was killed;”
Al-Mughira reports that the Prophet (ﷺ) said Allah has forbidden you to be undutiful to your mothers, to withhold what you owe or demand what you are not owed, and to bury your daughters alive.
A reward for raising daughters
The Prophet (ﷺ) said that whoever raises two girls until they come of age will stand with him on the Day of Resurrection. He and that person will be as close as two joined fingers. A poor mother once came to Aisha, his wife. Aisha gave her one date, and the mother split it between her two daughters. The Prophet (ﷺ) then said that daughters treated well will be a shield for their parent from the Fire (Hell). The Qur'an promises the same reward to every believer who does good, man or woman.
Anas ibn Malik reports that the Prophet (ﷺ) said: whoever raises two girls until they come of age will come on the Day of Resurrection with me like this, and he held his fingers together.
Aisha reports that a poor woman came to her with her two daughters, and she had only one date to give. The mother split it between her two daughters and left. When Aisha told the Prophet (ﷺ), he said that whoever is tested with daughters and treats them well, they will be a shield for him from the Fire.
“Whoever works righteousness, man or woman, and has Faith, verily, to him will We give a new Life, a life that is good and pure and We will bestow on such their reward according to the best of their actions.”
Widows became heirs
Ibn Abbas explains that before Islam a dead man's relatives could inherit his widow. One of them could marry her, marry her off, or stop her marrying at all. The Qur'an forbade inheriting women against their will. It gave women a fixed share of what parents and relatives leave. It gave the wife a set share of her husband's estate. She receives a quarter, or an eighth if he leaves a child.
Ibn Abbas explains that before Qur'an 4:19 was revealed, when a man died his relatives had the right to inherit his widow. One of them could marry her, or they could marry her off, or keep her from marrying at all, and they had more say over her than her own family. The verse was revealed to end this.
“O ye who believe! Ye are forbidden to inherit women against their will. Nor should ye treat them with harshness, that ye may Take away part of the dower ye have given them,-except where they have been guilty of open lewdness; on the contrary live with them on a footing of kindness and equity. If ye take a dislike to them it may be that ye dislike a thing, and Allah brings about through it a great deal of good.”
“From what is left by parents and those nearest related there is a share for men and a share for women, whether the property be small or large,-a determinate share.”
“In what ye leave, their share is a fourth, if ye leave no child; but if ye leave a child, they get an eighth; after payment of legacies and debts.”
A contrast with Ecclesiasticus
Ecclesiasticus is a book in the Catholic and Orthodox Old Testament. Its Greek text says that a daughter is born to her father's loss. The Greek has no word such as "foolish" here. The King James translators added one, in italics. The Catholic New Jerusalem Bible renders the line as saying that the birth of any daughter is a loss. The next verse praises a wise daughter. The Qur'an condemns the grief at any girl's birth, calls the father's choice evil, and makes no exception.
Ben Sira says that a badly brought-up son is a disgrace to his father, and that a daughter is born to his loss. The Catholic New Jerusalem Bible renders the second line as saying that the birth of any daughter is a loss.
“When news is brought to one of them, of (the birth of) a female (child), his face darkens, and he is filled with inward grief! With shame does he hide himself from his people, because of the bad news he has had! Shall he retain it on (sufferance and) contempt, or bury it in the dust? Ah! what an evil (choice) they decide on?”
Perspectives
The Islamic perspective
Daughters are a blessing and a trust, and raising them well brings a person close to the Prophet (ﷺ) on the Day of Resurrection. Islam ended the burial of baby girls and the inheriting of widows, and made women heirs.
Before Islam, some Arabs killed their children and buried infant girls alive.
The Qur'an condemns the father's grief and shame at the birth of a girl. It calls his choice to keep her in contempt or bury her evil.
The Qur'an speaks of the girl buried alive. On the Day of Judgement she will be asked for what crime she was killed.
The Prophet Muhammad (ﷺ) said Allah (﷾) has forbidden burying daughters alive.
The Prophet Muhammad (ﷺ) made a promise about raising girls. Whoever raises two girls to maturity will be close to him on the Day of Resurrection.
The Prophet Muhammad (ﷺ) said daughters treated generously will be a shield for their parent from the Fire.
Before Qur'an 4:19, a dead man's relatives could inherit his widow; the verse forbade it.
The Qur'an gives women a fixed share of inheritance, and the widow a share of her husband's estate.
In the Greek of Ecclesiasticus 22:3, scripture in the Catholic Bible, a daughter is born to her father's loss. The Qur'an condemns that very attitude.