O you who have believed, do not ask about things which, if they are shown to you, will distress you. But if you ask about them while the Qur'an is being revealed, they will be shown to you. Allah has pardoned that which is past; and Allah is Forgiving and Forbearing.
"We were forbidden in the Quran to ask the Prophet about anything not imperative…"
[Sunan al-Nasaai’i part of a long Hadith No. 2091]
This was so that nothing was made impermissible or obligatory as a result of their asking. They were forbidden from asking while the Qur'aan was still being revealed.
There are scholars who have said that this does not apply now since there is no fear of anything being made obligatory or impermissible.
The Verse gives insight into the inquisitive nature of humans. We always want to know things. At times, in life, we do not have answers to certain questions yet we continue to search for them.
Then, when we find the answers, we wish we had not known. Regret is all we get when we find the answers.
That is why it is best to leave things which do not concern us. We need to concentrate on things we really need to know. Just like knowing too little can cause problems, so can knowing too much.