Tom Riddle entered Ollivander's shop in 1938. Ollivander's put him through his usual audition process until a 13.5-inch yew wand, containing a tail feather from Fawkes the Phoenix, showed an attraction to him. He bought it.
Over 50 years later, 11-year-old Harry Potter, containing a piece of Voldemort inside him without knowing it, entered Ollivander's shop in 1991. He was put through the audition process until Ollivander, on a curious whim, handed him the Holly wand containing a second feather from Fawkes.
The wand sensed the presence of Voldemort's soul fragment and the powers it had conferred upon Harry and was attracted to him for the same reasons its brother had been attracted to Tom Riddle.
And so, Harry purchased the holly and phoenix feather wand.