Kafka had a lot of grief and issues in his personal life which reflected in his writings. In reality he felt trapped, unable to live as he pleased. And so, many of his stories are about people who are trapped, are desperate and hopeless.
His most famous work "The Metamorphosis" is about a man who wakes up to find himself metamorphosed into something disgusting. And suddenly he's unwanted, unattractive, his own family shuns him. In his book "The Castle" his protagonist is trapped in a vast labyrinth of bureaucracy whereas in "the Trial", his protagonist is charged for a crime he isn't even told
The world is a crazy, unjust place where people are blind to everything that's going wrong around them: about people being controlled and suppressed by family, friends and the society, about injustice and about apathy driven by selfishness. Kafka stories depict this craziness. There's pain in his stories, he manages to send his readers into utter gloom, probably a little bit of how he himself felt about his own life. Kafka used this beautiful literary technique to depict how people are indifferent to things that are wrong in this world. In his stories, he used surrealism, which are often unpleasant and disturbing. But his characters accept it as normal. For example in Metamorphosis, his protagonist wakes up one morning to discover he's not a human anymore but something else. But no one including the protagonist, wonders how did it happen. They behave as if it's completely normal for human beings to change permanently into something else. They even adjust their lives accordingly. And all this while, the reader keeps wondering "How can they act normally?”