When the muhajirun (the immigrants) came to Medina, a man married a woman of the Ansar. He began to do the same kind of action with her, but she disliked it, and said to him: We were approached on one side (i.e. lying on the back); do it so, otherwise keep away from me. This matter of theirs spread widely, and it reached the Messenger of Allah (ﷺ).
So Allah, the Exalted, sent down the Qur'anic verse: "Your wives are a tilth to you, so come to your tilth however you will," i.e. from in front, from behind or lying on the back. But this verse meant the place of the delivery of the child, i.e. the vagina.
In-book : Book 12, Hadith 119
English translation : Book 11, Hadith 2159