The prayer entitled "U'Netaneh Tokef" is attributed to a Rabbi Amnon of Mainz, Germany, who lived about one thousand years ago. The story behind this piyut, a prayer-poem, is sad and poignant, and may shed light on the prayer itself.
The Bishop of Mainz summoned Rabbi Amnon, a great Torah scholar, to his court and offered him a ministerial post on the condition that Rabbi Amnon would convert to Christianity. Rabbi Amnon refused. The Bishop insisted and continued to press Rabbi Amnon to accept his offer. Of course, Rabbi Amnon continued to refuse. One day, however, Rabbi Amnon asked the Bishop for three days to consider his offer.
As soon as Rabbi Amnon returned home, he was distraught at the terrible mistake he had made of even appearing to consider the Bishop's offer and the betrayal of G-d. For three days he could not eat or sleep and he prayed to G-d for forgiveness. When the deadline for decision arrived, the Bishop sent messenger after messenger to bring Rabbi Amnon, but he refused to go. Finally, the Bishop had him forcibly brought to him and demanded a response. The Rabbi responded, "I should have my tongue cut out for not having refused immediately." The Bishop angrily had Rabbi Amnon's hands and feet cut off and then sent him home.
A few days later was Rosh HaShanah, and Rabbi Amnon, dying from his wounds, asked to be carried to shul. He wished to say the Kedushah to sanctify G-d's Name and publicly declare his faith in G-d's Kingship.With his dying breath, he uttered the words that we now know of as the U'Netaneh Tokef.
Three days later Rabbi Amnon appeared in a dream to Rabbi Kalonymous ben Meshullam, a scholar and poet, and taught him the exact text of the prayer. Rabbi Amnon asked that it be sent to all Jewry and that it be inserted in the prayers of Rosh HaShanah and Yom Kippur for all time.
The prayer portrays G-d as a Shepherd over His flock, counting and examining each sheep one by one as it passes under His rod. So does He review the flock of humanity one by one, determining each individual's fate for the coming year.
But the individual human being is not just a helpless sheep! Rather, he or she can contribute to their verdict by altering their behavior towards G-d and Man, specifically in the areas of sincere Repentance, Prayer from the heart and Charity given with a cheerful spirit.
Full Text of U'Netaneh Tokef - In English