1 – What is mentioned in the question about the number of prayers is mistaken. It was 50 then it was altered to 5 prayers, a favour from the Lord of the Worlds to the Muslims.
2 – The rules of sharee’ah may be divided into two categories: those which may be understood on a rational basis; and those which are purely worship, the wisdom behind which is concealed from us and is not mentioned in either the Qur’aan or the Sunnah.
Examples of the first include: the prohibition on alcohol and gambling. Allaah has told us the reason why they are forbidden, which is:
“Shaytaan (Satan) wants only to excite enmity and hatred between you with intoxicants (alcoholic drinks) and gambling, and hinder you from the remembrance of Allaah and from As‑Salaah (the prayer). So, will you not then abstain?”
And there are other similar rulings.
Examples of the second kind include offering Zuhr prayer when the sun has passed its zenith, circumambulating the Ka’bah with it on one's left (i.e., anticlockwise), the nisaab of gold being a quarter of ten percent; Maghrib prayer being three rak’ahs, and many other such rulings.
What is mentioned in the question falls into this second category, which is things for which we do not know the reason from the Qur’aan or Sunnah, so we have to submit to the command of Allaah. This applies to all such rulings.
The Muslim has to accept the things for which Allaah has not explained the reason, and say as the believers say: “We hear and we obey.” He should not be like the Children of Israel who said: “We hear but we disobey.”
Accepting what Allaah says (interpretation of the meaning): “He [Allaah] cannot be questioned as to what He does, while they will be questioned” [al-Anbiya’ 21:23] is better for the believer in his religious and worldly affairs, for he is a slave who has a Lord, and the slave has no right to ask his Lord why He enjoined something. Rather he has to submit to His command. If he tells us why, we should do it, and if He does not tell us why, we should still do it.
3 – In al-Mawsoo’ah al-Fiqhiyyah al-Kuwaitiyyah (1/49-51) there is a useful discussion which we will quote here:
With regard to understanding the reasons why things have been prescribed, we may divide the issues of fiqh into two categories:
1 – Rulings whose wisdom may be understood on a rational basis, either because the reason is stated in the texts, or because it is easy to work out.
Such rulings are the majority of those that Allaah has prescribed, such as enjoining prayer, zakaah, fasting and Hajj in general, and such as enjoining the mahr (dowry) in marriage, ‘iddah (waiting period) following divorce or widowhood, spending on one’s wife, children and relatives, divorce when married life becomes unbearable, and many other such issues of fiqh.
2 – Ruling which are enjoined on us as a kind of pure worship. These are rulings in which the connection between the ruling and the action is not clear, such as the number of prayers, the number of rak’ahs and most of the actions of Hajj. By the mercy of Allaah, such rulings are few in relation to the rulings the wisdom behind which may be rationally understood. These rulings are prescribed as a test to demonstrate whether a person is a true believer. It should also be noted that sharee’ah – both general principles and minor details – does not prescribe anything that contradict common sense, but it may prescribe something the reason for which cannot be understood. There is a big difference between the two. If a person is rationally convinced that Allaah exists and that He is wise, and that He alone deserves to be acknowledged as Lord, and he is rationally convinced that the Prophet (peace and blessings of Allaah be upon him) is a true Prophet, then he affirms that Allaah is the Sovereign and the Lord, and that he is His slave. Then if he is commanded to do something or is forbidden to do something, and he then says, “I will not follow this ruling until I know the reason behind this command or prohibition,” then he has proven himself to be false in his claim to be a believer in Allaah and His Messenger. The human mind has a limit beyond which it cannot go.
The one who rebels against the rulings of Allaah that have to do with rituals is like a sick person who goes to a trustworthy doctor who prescribes various kinds of medicine for him, some to be taken before eating, some to be taken during the meal and some to be taken afterwards, in various amounts, and he says to the doctor: I will not take your medicine until you explain to me the reason why this one should be taken before eating and this one afterwards, and this one during the meal, and why are they are varying amounts, some small and some big? Does this patient really trust his doctor? The same may be said of a person who claims to believe in Allaah and His Messenger, then he rebels against the rulings the wisdom behind which he does not understand. The true believer, if he is commanded to something or forbidden to do something, says, “I hear and I obey,” especially when we have explained that there are no rulings that can be rejected on the basis of reason. Not knowing something does not indicate that it is not true. How many rulings are there, the reason for which has been concealed from us in the past, then we discovered that there is great wisdom behind them? The reason why pork is forbidden was unknown to many people, then we found out that it carries germs and disease and other bad things, and Allaah wanted to protect the Muslim society against them. The same may be said concerning the command to wash vessels that have been licked by a dog seven times, one of which should be with earth… and other rulings the wisdom behind which may be discovered one day even though it is hidden from us now.
And Allaah knows best.