In Paoulo Coelho's The Alchemist, the word "maktub" is first introduced to Santiago (the boy) by the crystal merchant. The boy hears it later spoken around the campfire as he (and the Englishman) journey with the caravan to the oasis.
Santiago is swindled out of all the money he has received by selling his sheep. He is stranded, unable to return home or move on. As much as he dislikes his situation, he gets a job with a crystal merchant. This is certainly a part of God's greater plan for Santiago, for he learns a great deal from the crystal merchant, most specifically about pursuing one's Personal Legend. The crystal merchant missed his opportunity to do so; Santiago finally decides he will not make the same mistake.
One evening, as the boy and the merchant speak, the crystal merchant utters an Arabic word that Santiago does not understand (although they are both speaking Arabic). The older man explains that in the boy's language, "maktub" means "it is written." This gives the sense that it presents a truism: it might be thought to mean, "it is so," or "this is how it should be."
When the boy presents another suggestion to the merchant to serve tea to thirsty travelers in the crystal glasses—to refresh them and to sell crystal, the merchant admits that he is slow to change because he likes things the way they are. However, he agrees to the change, and says, "maktub." He is saying "it will be so." And the sense with this word appears to be that this change is preordained. This is the way it is supposed to be.
When Santiago and the Englishman begin their trek to the oasis, a camel driver offers his advice:
"Once you get into the desert, there's no going back...And, when you can't go back, you have to worry only about the best way of moving forward. The rest is up to Allah, including the danger."
And he concluded by saying the mysterious word: "Maktub."
It appears that the word "maktub" means this is the way it will be and there is no point fighting it. As far as Santiago is concerned, the universe does, in fact, conspire to bring about his happiness, and "maktub" is basically saying that this is the way it is, the way it will be. And as the omens and nature lead him on, Santiago's path seems certain—perhaps unavoidable—for he is in tune with the world, and it will show him the way.