When Harry Potter first arrived at Ollivander's to purchase his wand he had attempted several with no success.
Harry tried – but he had hardly raised the wand when it, too, was snatched back by Mr Ollivander.
Harry Potter and the Sorcerer’s Stone
And this quote indicating that he had tried so many:
The pile of tried wands was mounting higher and higher on the spindly chair, but the more wands Mr Ollivander pulled from the shelves, the happier he seemed to become.
Harry Potter and the Sorcerer’s Stone
But, when he finally got the wand he was destined for:
Harry took the wand. He felt a sudden warmth in his fingers. He raised the wand above his head, brought it swishing down through the dusty air and a stream of red and gold sparks shot from the end like a firework, throwing dancing spots of light on to the walls.
Harry Potter and the Sorcerer’s Stone
It just worked for him, or gave him a sign.
(I apologize, I don't have the actual page numbers for the references)
So my question is this. Why would the wand selection process be so complicated, yet when he disarmed Malfoy the wand worked normally:
Harry looked down at the hawthorn wand that had once belonged to Draco Malfoy. He had been surprised, but pleased, to discover that it worked for him at least as well as Hermione's had done.
Which also points out that he borrowed Hermione's wand versus disarming her, and yet it worked for him.
There are other parts in the series which explain how wands are constantly either stolen, disarmed, or acquired in numerous ways, but they all just seem to work.
According to Ollivander (can't find the quote), the allegiance of a wand can change, which might explain the disarmament of Malfoy. Yet, it doesn't explain the borrowing or purchasing of the wands.
Was it due to Harry's inexperience, or perhaps the wands at the shop realized he was an inexperienced wizard, or is there more do it? Perhaps Ollivander owns the wand and when he sells it, the allegiance changes?