You have asked an excellent question about this fascinating story. One central theme that can be clearly identified is the relationship between the artist and their audience - note the title of the story and the way that the central protagonist calls himself an "artist." Kafka seems to be using the hunger artist to raise serious questions about the relationship between the artist and their audience.
It is important to note that the hunger artist dedicates himself totally to his career. He craves the attention and wonder that his art gains and is delighted when the whole town is interested in his art:
He was quite happy at the prospect of spending a sleepless night with such watchers; he was ready to exchange jokes with them, to tell them stories out of his nomadic life, anything at all to keep them awake and demonstrate to them again that he had no eatables in his cage and that he was fasting as not one of them could fast.
Yet, although the interest, appreciation and curiosity of the crowd brings him joy, he remains deeply unsatisfied with his performance. He feels limited by the 40 day fasting limit imposed on him and also feels that the audience really do not appreciate his art in the way it should be:
Why stop fasting at this particular moment, after forty days of it? He had held out for a long time, an illimitably long time; why stop now, when he was in his best fasting form, or rather, not yet quite in his best fasting form? Why should he be cheated of the fame he would get for fasting longer...?
We can imagine that his struggles with his relationship with the audience is typical of many artists, who want their art to be appreciated for what they feel it is, rather than the packaged-for-presentation nature of art that is savoured by the public. Eventually, his art goes out of vogue and he is consigned to a circus and, ironically, given free reign to practice his art for as long as he wants, but to a disinterested audience.
"The Hunger Artist" therefore raises serious questions about the relationship between artists and their audience, and the struggle between the purity of art and the way that art is often misinterpreted or misrepresented to an uncaring and fickle audience.