They had been popping around trying to find an owl that they both got on with when one Hermione knocked into a shelf full of glass tanks. When a hissing voice called out in annoyance Hermione responded without a second thought, Harry gaped. It was at that point that he realized that the potion had shared more than their DNA, but their magic as well. Seeing as his gift for parseltongue was from Voldemort and not hereditary, there was no other way for Hermione to have gotten it.  