According to the Platform Sutra, the fifth patriarch of Chan Buddhism held a poetry contest to determine his successor. But it became a contest for the soul of Chan Buddhism itself.

The patriarchs of Chinese Buddhism (Chan Buddhism, which later grew into Zen Buddhism) were a series of religious leaders from the 5th to the 8th century CE. They formed a chain – the teacher teaching the student, who went on to become a teacher, and so taught the next student – that supposedly went back to Gautama Buddha himself. Each patriarch chose his successor, the next in line for the dharma lineage. But the fifth patriarch, Daman Hongren, did something a little different. He held a poetry contest.
(Side note: this account comes from the Platform Sutra of the Sixth Patriarch. There are a number of good reasons to question its historical accuracy, but that in itself is an interesting story. We’ll get to that part later.)
So, Daman Hongren invited his pupils to write a poem that would express the essence of Buddhism. His star pupil, Yuquan Shenxiu, wrote a poem:
The body is the tree of enlightenment,
Zen sourcebook
The mind is like a bright mirror’s stand;
Time after time polish it diligently,
So that no dust can collect.
But he was shy, or hesitant, so he wrote it anonymously on a monastery wall. Enter Huineng, an illiterate novice who had turned up at the monastery just eight months earlier. Hearing Shenxui’s verse, Huineng asked a friend to write down his own response:
Enlightenment is not a tree,
Zen sourcebook
The bright mirror has no stand;
Originally there is not one thing-
What place could there be for dust?
Underlying these two poems was a core question for Chan Buddhism. Is enlightenment something that you work at daily, a constant challenge to fulfill, or does it wash over you as a sudden epiphany? The patriarch chose Huineng as his successor… but then Huineng had to flee the monastery because of the other acolytes, jealous at the selection of an illiterate “barbarian” patriarch. Huineng became the secret “true” patriarch, but in public Shenxui became the official patriarch.
So, that’s the account in Huineng’s biography, the Platform Sutra. But other sources of the time honour Shenxui, barely mention Huineng, and don’t say anything about a poetry contest for the soul of Chan Buddhism. Instead, this story was probably created by the successors of the secret patriarch. They did so to bolster their own position, to retroactively claim the title of the sixth patriarch and thus the dharma lineage. One in particular, an 8th century monk named Shenhui, is probably the one who elevated Huineng, because Huineng was Shenhui’s own teacher. Even the contrast between constant and sudden enlightenment may have been their fabrication, a way to drive home the difference.
In any case, this rewriting of history was successful: today Huineng is recognised as the sixth patriarch and sudden enlightenment is a core tenet of Chan and Zen Buddhism.