Well, it could be many reasons. Maybe there was a misunderstanding. Some dark magic might have been used to make his friends think he did something bad. Or perhaps a powerful enemy framed him by planting false evidence. It's hard to say exactly without more context from the fanfiction.
Harry might survive in Azkaban because of his connection to his friends, even if they betrayed him. Their memories could give him the strength to hold on. And he may be able to use his magic in unique ways. He could draw on the positive emotions he has left, like his love for his parents, to create a shield against the Dementors. Plus, he may be constantly looking for a way to prove his innocence and that hope could keep him alive.
One possible plot could be that Harry is framed for a serious crime he didn't commit. Maybe someone has used Polyjuice Potion to look like him while doing dark magic. The wizarding community, believing the false evidence, sends him to Azkaban. In Azkaban, he has to endure the Dementors and try to prove his innocence from within the prison walls.
It could be a jealous classmate from Hogwarts. Someone who has always been in Harry's shadow and finally sees an opportunity to get rid of him. This person might be a Slytherin who has connections with some dark wizards outside of school and they work together to frame Harry.
Some fanfictions might have a plot where Harry goes to Azkaban to rescue someone. It could be a friend or a relative who has been wrongly accused. Along the way, he has to navigate the dangerous corridors of Azkaban filled with various traps and curses. He might also meet some old enemies who are also in Azkaban and they try to stop him from achieving his goal. In addition, the magic that keeps Azkaban intact could be a key part of the story, like Harry has to figure out how to manipulate it to his advantage.
In this fanfiction, perhaps Harry goes to Azkaban to rescue someone. It could be a fellow wizard who has been unjustly imprisoned. He might have to use his skills and some new-found magic to navigate the dangerous and dreary corridors of Azkaban, all while avoiding the Dementors.
Obviously, Harry Potter himself is a main character. Hermione and Ron often play important roles too. They might try to break Harry out of Azkaban or help him from the outside. Sometimes, Sirius Black could also be involved, especially if the story is related to the secrets of Azkaban or the wrong imprisonments. Dumbledore could also be a key figure, guiding Harry or influencing the events from afar.
One possible plot could be that Harry is wrongly accused of a serious crime within the wizarding world and is sent to Azkaban. There, he discovers a dark secret about the prison itself, like there being a hidden force controlling the Dementors. He has to use his skills and the loyalty of his friends to expose this secret and clear his name.
Obviously, Harry Potter himself is the central character. Hermione and Ron would most likely be involved too. They would probably try to find a way to get Harry out of Azkaban. Dumbledore might also play a role, perhaps guiding Hermione and Ron from behind the scenes or even trying to influence the wizarding court to re - evaluate Harry's case.
It could be a corrupted prison guard. They might be taking advantage of the chaos in Azkaban to carry out their own evil plans, like stealing magic from the prisoners. Harry would have to stop them while also dealing with his own situation in the prison.