Your understanding is incorrect as evidenced by the fact that somebody wrote down what Muhammad said.
I was teasing MeshugeMikey, English didn’t exist as a language in the 7th century
The trilogy (the three documents which make up the Islamic faith)....are mostly about what others remembered from the various stories. The trilogy comes up after Muhammad passes on and there’s a serious group of members who are tired of the violent nature of the religion...desiring now to separate and walk away. The leadership left of the religion then starts to collect the stories, mount an offensive against those trying to quit, and keep the thing going.
Once you into the stories....it goes in various directions. At some point, Muhammad even offers advice on keeping a dog. You get to a point of wondering why you need some prophet telling you advice on dogs. The same way with him telling you how to beat your wife properly.