Magnets.
The word had popped into Harry's head unbidden, but it fit the situation quite well.
His best friends were like magnets.
Hermione shook him from his daydreaming as she almost dropping her books to avoid walking down the same hall as Ron. He followed her around the long way to class, wondering if she remembered that they were going to end up in the same classroom anyway.
As they settled in class, Harry returned to his comparison of Ron and Hermione to magnets.
It was very simple. They were, at their very core, attracted to one another. Gravitating to the company of the other was their natural state, and bad things happened when this was not the case.
Ron sent a paper airplane across the room to Harry's desk, asking what homework was due the next day. He couldn't remember, and slid the note to Hermione, hoping she could inform them both.
Hermione gently tapped her wand against the paper. It burst into flames.
That night in the Gryffyndor common room, Harry sat working on an essay, when he saw Ron bravely approach Hermione about that night's homework. She glared at him, but his puppy dog eyes eventually won out, and she began to help him with their work.
The thing about magnets, the thing about Hermione and Ron, is that it just takes too much energy for the two of them to remain apart.