From the moment they first crossed paths, the similarities between Tom Riddle, aka Voldemort, and Harry, the boy he would later try and kill, were pretty clear. In Chamber of Secrets, when Harry encountered the diary-preserved form of Tom Riddle, Riddle remarked:
And Voldemort's actions only strengthened those connections. In trying to kill Harry as a baby, Voldemort actually made him into a Horcrux. Years later, in taking Harry's blood, Voldemort bound them together even more tightly. They were both descended from the Peverells. They had wands that shared a core. And of course, they were both alone until they came to Hogwarts: two Muggle-raised half-bloods arriving in a place they could finally feel at home.
Tom Riddle might have come to Hogwarts with an over-inflated sense of his own worth – when Dumbledore came to offer Riddle a place, he said he'd always known he was special – but there’s no doubt his childhood had been tough. With no family to speak of, raised in an orphanage where he didn’t fit in, Hogwarts gave Riddle a sense of himself, a history he could claim, and access to friends who would later become followers. It's fair to say he took advantage of all these things, but we can’t blame Hogwarts for the mockery Riddle made of his welcome.
Riddle might have immediately felt he’d found his rightful place at Hogwarts, but for Severus Snape, the process seemed more gradual.
Snape also had something of an unhappy childhood. There were lots of arguments, and Snape’s father didn't like magic, or anything, much. So Hogwarts, which Snape talked about endlessly before he arrived, represented a new beginning. Snape was Sorted into his house of choice, Slytherin; welcomed by prefect Lucius Malfoy; and became friends with Avery and Mulciber, who all later became Death Eaters. Meanwhile, his interest in Dark Magic grew, as he recorded nasty spells in his Half-Blood Prince textbook.
But if Hogwarts represented a new beginning for Snape, then it was a story that quickly turned dark. And it might have been even worse, were it not for one person: Lily Evans.
While Snape’s friendship with Lily didn't prevent him from exploring the Dark Arts at Hogwarts, she did at least force him to think twice and consider his choice of friends. It was Lily who pointed out Avery and Mulciber’s cruelty, and Lily who called Snape out for using the word Mudblood. But even she couldn't stop him from going down that dark path, so when Lily finally cut ties, Snape no longer had any reason not to become a Death Eater himself.
And when it all, finally, really fell apart for Snape – when Lily was dead – where did he go? He went back to Hogwarts. Back to the place he’d been so desperate to get to, the one place he could call home. After that, it seems, he never left.
In the final chapters of Deathly Hallows, as Harry walked through the Hogwarts grounds towards Voldemort and towards his death, he reflected on the similarities between himself, Riddle and Snape:
Just as Riddle and Snape before him, Harry arrived at Hogwarts’ huge front door from a world where he'd never felt at home. Like Riddle, he preferred to stay at Hogwarts for the school holidays. Like Snape, he found belonging in his Hogwarts house. But he had an instinctive distaste for the kind of pure-blood ideals Voldemort was drawn to, and he never sought to use his time at Hogwarts to build followers or explore Dark Magic.
For Harry, Hogwarts was simply home. Obviously it wasn't all plain sailing, but those visits to Hagrid’s hut, the parties in Common Room, the meals in the Great Hall, the games on the Quidditch pitch – that was where Harry was truly himself. And as he faced those final moments, he recognised just how much Hogwarts had given him. Dumbledore once told Harry 'It is our choices, Harry, that show what we truly are, far more than our abilities…’ and if Riddle chose to make a mockery of the welcome Hogwarts gave him, then Harry’s choice – to sacrifice himself on the grounds of the one place he’d ever felt welcomed – showed the depths of his appreciation.
Harry, Voldemort and Snape weren’t the only abandoned children to find a home at Hogwarts. That draughty castle provided a warm welcome to many students over the years, including…
Not only was Neville living without his parents before he arrived at Hogwarts, his relatives had so little faith in his magical abilities he once got dangled out of a window by his ankles. But as anxious and self-conscious as he may have been when he arrived, by the end of his school career Neville was a sword-carrying Gryffindor through-and-through, leading rebellions and killing snakes and taking on Voldemort without batting an eyelid. Hogwarts nurtured Neville. He found friends and interests and talents to take forward into adult life, eventually becoming a Hogwarts professor himself.
Hagrid’s hut was as much of a Hogwarts fixture as the Great Hall and the Quidditch Pitch. Not even being expelled – and then, years later, arrested – after being unjustly accused of opening the Chamber of Secrets could tear Hagrid away from his home for long, and we have Dumbledore to thank for that. As Harry himself said in the film version of Chamber of Secrets: ‘There’s no Hogwarts without you, Hagrid.’
Hagrid wasn't the only Hogwarts professor Dumbledore allowed to stay after others attempted to force them out. Sybill Trelawney might have been a questionable Divination teacher but she, like many of Harry's professors, had made her home at Hogwarts. Dumbledore wouldn't hear of her being kicked out, even if it did mean angering Umbridge even more than he had done already.
Lastly, there was Dumbledore himself. So closely associated was Dumbledore with the school he led for so many years, he was even laid to rest there after his death. Which is pretty fitting. After all, Dumbledore's Hogwarts was a place of welcome and refuge, so it makes sense that it became the final home for the man who did so much to make it one.