When therefore he saw them compass'd about with the Curtains of Punishment, and cover'd with the Darkness of the Veil; and that all of them (a few only excepted) minded their Religion no otherwise, but with regard to this present World; and cast the Observance of religious Performances behind their Backs, notwithstanding the Easiness of them, and sold them for a small Price; and that their Merchandize and Trading diverted them from thinking upon God, so that they had no fear of that Day in which both their Hearts and Eyes shall be turn'd round; he was fully satisfied, that it was to no purpose to speak to them plainly, neither that it was expedient any Works should be enjoin'd them beyond this Measure; and that the greatest Benefit which accru'd to the common sort of Men by the Law, was wholly plac'd in Relation to Things of this World, viz. that they might be in a comfortable way of Living, and that no Man might invade another's Property.--Ibn Tufayl, Hayy Ibn Yaqzan (Translated by Simon Ockley 1708).
I have quoted the passage in which Hayy Ibn Yaqzan (recall and here) recognizes that returning to the cave is pointless. Earlier he had tried to teach "Mysteries of Wisdom" but was not successful even with the men of learning who are (besides being rather positivistic) "Lovers of Goodness, and desirous of Truth," let alone the masses. (In context, it's clear that Hayy works with an intellectual trickle down theory; his failure to persuade the elite means he believes he has no chance with the masses.) It is tempting to treat this as Ibn Tufayl's parable on the limits of enlightenment; by itself the truth is unpersuasive and, therefore, not authoritative. But it is worth noting that Hayy fails to recognize that his mode of instruction is, in part, to blame. This is not said by Ibn Tufayl, but just a few pages before, we have learned that "true religion" had "spread" on the island "by way of Parable and Similitude, and by that means represent the Images of them to the Imagination, and fix the Impressions of them in Men's Minds, as is customary in such Discourses as are made to the Vulgar." So, the transition problem -- [recall], that is [recall also here and here] how to how to create the best political organization with a population raised under bad institutions (or worse, that is, bad breeding) (remember also Al-Farabi here) -- is solved by the introduction of true religion from elsewhere. (In a commercial society, where even the ruler relies on the opinion of the people, the/a King has to convert to the same religion once the majority believes in it.)+ Hayy fails to recognize that he can spread truth and enlightenment indirectly.*
Ibn Tuyfayl describes the Platonic notion of religion (inherited from Al-Farabi) as a second (or third) best means to represent the truth. This is religion that also includes a cosmogony and metaphysics ("A Sect which us'd to discourse of all things in Nature.") Note, first, that this religion does not rely on so-called noble lies. Second, this religion is not itself a barrier to truth is exhibited in the story by way of the trajectory of Hayy's only disciple, Asâl, who was raised in this true religion and finds the hypocrisy of his fellow coreligionists unbearable. (The "true religion" has more than superficial similarity with Islam.)
Hayy notes, however, with horror that in a commercial society ("Merchandize and Trading"), there are no genuine believers (at least as is clear from their revealed preferences) in the afterlife. (Asâl seems to be the only product of that society who does.) Then he offers a functional explanation of of religious law (Sharia), which, it seems Hayy, attributes to the vast majority of the common people themselves: "that they might be in a comfortable way of Living, and that no Man might invade another's Property." That is, religious law secures property rights and this-worldly pleasures (Marx would not be able to improve on this).
Hayy's observation of the functionality of religious law in a commercial society fits with an earlier observation this time attributes to Salâman, (who eventually becomes king by the time Hayy shows up to teach the truth). We don't know how Salâman became king--he is not described as a prince when we first encounter him (he is a friend of Asâl). It seems he was either appointed by the people, who are a successful revolutionary. Salâman is also pious, but more sociable ( applied himself to Conversation) than Asâl; he had a "natural Aversion to Contemplation, and nice sifting of things." Salâman sees other benefits to social life in a commercial/religious society:
And he thought that Conversation did drive away evil Thoughts, and banish'd that Diversity of Opinions which offer'd themselves to his Mind, and kept him from the Suggestions of evil Thoughts.
Being part of a sociable, religious community disciplines not just others, but selves; that is Salâman understands the mechanism of religious spectatorship provides the incentives and means of self-command whereby the mind stays focuses on and, thereby, conforms to the approved good.
While it is easy to read Ibn Tufayl's tale as advocating for a removal from political and social life for those of us who wish to be like angels, it is worth noting that along the way he does explain the utility of revelation and religious law to political life.
+This may help explain why the book was translated into English in 1708 (to secure the Whig settlement).
*This should make us wonder if he is really presented as a positive exemplar. (See also Kochin.) There is another hint of this tale; Ibn Tufayl treats Hayy, when he is isolated, as a cave-dweller. (Ibn Tufayl repeatedly alerts the reader that he teaches via "hints.")