It wasn't Harry who held the trio together. It was Ron who was the heart of the group.
Ron and Hermione spent PLENTY of times together without Harry and they really liked each other's company.
Just a quick reminder to all the people out there who say that Ron and Hermione weren’t actually friends and only hung out together whenever Harry was around and because of him, let me remind you that:
It’s clearly stated that in every book after Cos, Hermione arrives at wherever Ron is staying (the Burrow, the Leaky cauldron, Grimmauld place) and hangs out with him before Harry arrives. If they only hung out with each other because of Harry, she wouldn’t have come early to be with him.
Ron and Hermione are constantly described as being together in the common room, the quidditch pitch, etc. when Harry comes back from detention or a special conversation with Dumbledore, he always finds them sitting together, chatting, playing chess, or just lounging around. They usually look comfortable and happy around one another. If Hermione didn’t think of Ron as a friend, she would absolutely have no problem sitting by herself waiting for Harry. But yet they are constantly seen being around each other, even when Harry isn’t there.
Hermione and Ron are not the sorts of people who would pretend to be friends with someone when they’re not. They both wear their hearts on their sleeves, although in different ways. If they didn’t like each other as friends, even Harry-oblivious-Potter would notice. They both are not good at hiding their true feelings, and certainly not for 7 years.
They literally went to Hogsmeade alone together and came back “looking like they’ve had the time of their lives”. And again, if Hermione didn’t want to go with Ron, she would have no problem going alone. They choose again and again to spend time together, even just the two of them, no one is forcing them to do that.
So of course they would become great friends. Sure they would have hated each other at 1st as they did in canon. But eventually, they would have become good friends and after some years lovers.