I'm not entirely sure what you mean by the relationship between celibacy and Muhammad.
Basically the doctrines relating to celibacy were put into place before the time of Muhammad, around the 5th century AD. They are drawn largely from the writings attributed to Paul, who expressed a lot of disdain for the physical body and its needs, particularly sex. This was expanded by other canonical and non-canonical writings, but was not accepted by the mainstream movements of the religion (there was no solid single church entity until around the 4th century AD) until it was advocated for by St. Augustine of Hippo.