[3] Kiai were distinct from the pangulu, the state officials: The pesantrens were typically (although not uniquely) located in rural districts, away from the major roads.
The pangulu, as a state official, and the independent teacher, the kiai, were two contrasting types, in Banten as well as elsewhere in Java.
[2] In legend, if not in fact, a kyai combines the skills and roles of both the Islamic scholar and the Sufi master (sheikh or syehk).
[6][7] In some parts of Indonesia, famous students of the Wali Songo mystics are referred to historically as kyai or kiai or ki.
One of them, Ki Ageng Gribig, is said to have returned from Mecca with a small kind of pastry which did not spoil during the long journey.
To commemorate this feat, the people of Jatinom hold a festival each year, wherein thousands of these little cakes (called apem) are blessed and tossed out to participants.