They have realized the truth of divine messages and possess...
They have realized the truth of divine messages and possess the treasures of unseen knowledge. It is due to this same reason that they are immune from mistakes and errors. Since the existence of such a perfect and infallible man is necessary for prophethood, Allah, the Mighty and Sublime has arranged the system of creation in such a way that when needed, such a person would be available.
It is said that although the prophet is infallible and does not commit any kind of sin, it is not that the capacity of committing sins has been taken away from him. Instead, the prophet is also like other people; he is capable enough to commit sins and has the choice to commit them; at the most, under the influence of a strong faith and perfect insight, which is placed in his being as a divine gift, by choice and intention he gives up evil deeds and does not fall into divine disobedience.
so He does not reveal His secrets to any. Except to him whom He chooses as an apostle; for surely He makes a guard to march before him and after him.
So that He may know that they have truly delivered the messages of their Lord, and He encompasses what is with them, and He records the number of all things.” (72:26-28) Allamah Tabatabai has written under the exegesis of this verse: Apparently this verse shows that Almighty Allah has chosen the prophets for divine revelation and also gave them a hidden power which accords protection to them.
It is that Almighty Allah has surrounded the prophets in order to guard revelation from destruction and change which Satan or others may undertake. This is due to the joining of prophethood to the stage of manifestation.