Harry Potter and the Prisoner of Azkaban introduces the reader to two generations of friendships: those between Harry and his friends in the present day, and those between Harry's father, James, and James's crew while they were students at Hogwarts. By exploring the contours of the different friendship generations and how the friendships evolve over time, the book positions how a person treats their friends as an indicator of maturity and selflessness—or as an indicator of a lack thereof.
For much of the novel, Hermione finds herself at odds with Ron and Harry. Ron is understandably angry when Hermione chooses to adopt Crookshanks, an orange cat intent on murdering his rat, Scabbers, while both boys are beside themselves when Hermione tells Professor McGonagall about the Firebolt broom that Harry receives mysteriously at Christmas. For Hermione, particularly in the case of the Firebolt, her close friendships with Ron and Harry are worth sacrificing in order to keep the two safe and healthy (she suspects the Firebolt came from Sirius Black, whom they believe at that point is trying to kill Harry). This suggests that at times, being a good friend means going against a friend's wishes with the understanding that, eventually, the angry friend will appreciate the gesture and concern. However, for most of the novel, this concept is lost on Harry and Ron. Instead, they blame Hermione for their misery and refuse to speak to her, which means that Hermione is alone and effectively friendless at a time in her life when, thanks to her use of the Time-Turner, she could really use camaraderie. Eventually, Hagrid takes it upon himself to talk to the boys about Hermione and their treatment of her. He disappointedly tells them that he'd hoped they'd know enough to prioritize friendships over objects, which is the kick that Harry and Ron need to make up with Hermione and move in the direction of a more mature view of friendships and relationships.
The novel explores these ideas in a slightly different way in the case of James Potter, Sirius Black, Remus Lupin, and Peter Pettigrew, who are adults or deceased in the present but attended Hogwarts a generation before the trio. Lupin was allowed to attend Hogwarts in spite of the fact that he's a werewolf--in the wizarding world, werewolves are shunned and experience discrimination, as they're believed to be subhuman and dangerous. The Shrieking Shack and an accompanying tunnel, guarded by the Whomping Willow, were constructed so he had a safe place to transform every month, and Lupin's true identity was kept secret from the student body. Lupin's friends, however, became understandably curious about where and why he disappeared every month. When they learned the truth, rather than shunning him, they set out to figure out how to turn themselves into Animagi, humans who can transform into animals at will.
Because of the dangers associated with turning oneself into an Animagus, Lupin sees this as the ultimate sacrifice on the part of his friends--they could've died or suffered permanent damage had things gone wrong, let alone the fact that attempting the transition without Ministry supervision is illegal. However, at the time, this also appeared to be the ultimate act of friendship. James, Sirius, and Peter weren't in danger around the werewolf Lupin in their animal forms, which enabled them to turn Lupin's horrifying monthly transformation into something exciting, fun, and, most importantly, something he didn't have to go through alone. With friends, the experience became bearable.
It's important to note that in the novel's present, Lupin and Sirius acknowledge that what they did as teens was shockingly dangerous and immature of them--their gallivanting could have easily resulted in Lupin biting someone, while becoming Animagi in the first place represented a similarly dangerous lack of judgment. In the present, Harry and Ron's choice to ignore and be mean to Hermione comes across as stubbornly immature to both the reader and the adults in the trio's lives. By offering the adults' mature perspective on their own teenage friendships, however, the novel offers the hope that Harry and Ron will one day recognize their immaturity at this point in time. In the same vein, the progress that the friends do make in this regard over the course of their third year acts as proof that they are well on their way to growing up, developing adult relationships, and acquiring increasingly more mature critical thinking skills.
Friendship and Growing Up ThemeTracker
Friendship and Growing Up Quotes in Harry Potter and the Prisoner of Azkaban
But this didn't tally at all with Harry's past dealings with the Ministry of Magic. "Last year, I got an official warning just because a house-elf smashed a pudding in my uncle's house!" he told Fudge, frowning. "The Ministry of Magic said I'd be expelled from Hogwarts if there was any more magic there!"
"Why didn't you let me fight it? said Harry abruptly.
Lupin raised his eyebrows.
"I would have thought that was obvious, Harry," he said, sounding surprised.
Harry, who had expected Lupin to deny that he'd done any such thing, was taken aback.
"It's very lucky he picked tonight, you know," said Hermione as they climbed fully dressed into their sleeping bags and propped themselves onto their elbows to talk. "The one night we weren't in the tower..."
"I reckon he's lost track of time, being on the run," said Ron. "Didn't realize it was Halloween. Otherwise he'd have come bursting in here."
"Anyone?" Snape said, ignoring Hermione. His twisted smile was back. "Are you telling me that Professor Lupin hasn't even taught you the basic distinction between--"
"We told you," said Parvati suddenly, "we haven't got as far as werewolves yet, we're still on--"
"Silence!" snarled Snape.
"Well, isn't it obvious?" said Hermione, with a look of maddening superiority.
"If you don't want to tell us, don't," snapped Ron.
"Fine," said Hermione haughtily, and she marched off.
"She doesn't know," said Ron, staring resentfully after Hermione. "She's just trying to get us to talk to her again."
Hermione burst into tears. Before Harry could say or do anything, she tucked the enormous book under her arm, and, still sobbing, ran toward the staircase to the girls' dormitories and out of sight.
"Can't you give her a break?" Harry asked Ron quietly.
"No," said Ron flatly. "If she just acted like she was sorry--but she'll never admit she's wrong, Hermione. She's still acting like Scabbers has gone on vacation or something."
"I'm not blamin' yeh!" said Hagrid, waving Harry's apology aside. "Gawd knows yeh've had enough ter be gettin' on with. I've seen yeh practicin' Quidditch ev'ry hour o' the day an' night--but I gotta tell yeh, I thought you two'd value yer friend more'n broomsticks or rats. Tha's all."
"Malfoy's dad's frightened the Committee into it," said Hermione, wiping her eyes. "You know what he's like. They're a bunch of doddery old fools, and they were scared. There'll be an appeal, though, there always is. Only I can't see any hope....Nothing will have changed."
"THE DARK LORD LIES ALONE AND FRIENDLESS, ABANDONED BY HIS FOLLOWERS. HIS SERVANT HAS BEEN CHAINED THESE TWELVE YEARS. TONIGHT, BEFORE MIDNIGHT...THE SERVANT WILL BREAK FREE AND SET OUT TO REJOIN HIS MASTER. THE DARK LORD WILL RISE AGAIN WITH HIS SERVANT'S AID, GREATER AND MORE TERRIBLE THAN EVER BEFORE."
"I was terrified they would desert me the moment they found out what I was. But of course, they, like you, Hermione, worked out the truth...
"And they didn't desert me at all. Instead, they did something for me that would make my transformations not only bearable, but the best times of my life. They became Animagi."
"That was still really dangerous! Running around in the dark with a werewolf! What if you'd given the others the slip, and bitten somebody?"
"A thought that still haunts me," said Lupin heavily. "And there were near misses, many of them. We laughed about them afterwards. We were young, thoughtless--carried away with our own cleverness."
"Yes, I do," said Dumbledore quietly. "But I have no power to make other men see the truth, or to overrule the Minister of Magic..."
Harry stared up into the grave face and felt as though the ground beneath him were falling sharply away. He had grown used to the idea that Dumbledore could solve anything. He had expected Dumbledore to pull some amazing solution out of thin air. But no...their last hope was gone."