The need for such procedure emerged because in his days, the prophet was engaged in making relations with all the creatures of allah, the goat, the hen, the males, the females etc. In summary whereever he found hole, he tried to put his tool in that, and this damaged his foreskin badly and risk of HIV, germs etc. increased. Then he derived this unique formula jisse ki "Saanp (germs) bhi mar jaye, aur lathi (his tool) bhi na toote"