This was revealed concerning a man who has an orphan girl in his care, being both her guardian and her heir. She has wealth, and there is no one to dispute with him on her behalf. So he refuses to marry her off, keeping her for the sake of her wealth, harming her and treating her badly as a companion. So Allah said, "And if you fear that you will not deal justly with the orphan girls, then marry those women lawful to you" [Nisa 4:3]. He is saying, marry from among those I have made lawful for you, and leave this girl whom you are wronging.
في قوله تعالى: {وإن خفتم ألا تقسطوا في اليتامي}
أنزلت في الرجل تكون له اليتيمة وهو وليها ووارثها، ولها مال، وليس لها أحد يخاصم دونها، فلا ينكحها لمالها، فيضر بها ويسيء صحبتها، فقال: {وإن خفتم ألا تقسطوا في اليتمى فانكحوا ما طاب لكم من النساء} يقول: ما أحللت لكم، ودع هذه التي تضر بها.
Bukhari related it in the tafsir (4573) and Muslim in the tafsir (3018:7), both of them through Hisham bin Urwa, from his father, from Ayesha, who related it as mentioned. The wording is that of Muslim, and the wording of Bukhari is similar.