All Praise to Allah Subhan o Taala and blessings on Prophet Muhammad peace be upon him His Family and Companions
From some narrations we get to know that blessed hairs of Prophet Muhammad peace be upon him were distributed among his companions and later on it is transferred among the generations and preserved.
Anas (May Allah be pleased with him) reported:
When Messenger of Allah (ﷺ) went to Mina, he came to Jamrat-ul-'Aqabah and threw pebbles at it. After that, he went to his lodge in Mina and sacrificed. Then he called for a barber and pointed his right side to him, said, "Shave from here." Then he pointed his left side and said, "Take (hair) from here." Then he distributed his hair among the people.
[Al-Bukhari and Muslim].
Another narration is: After the Messenger of Allah (ﷺ) had thrown pebbles at Jamrah and sacrificed an animal, he turned the right side of his head towards the barber who shaved it for him. Then he called Abu Talhah Ansari (May Allah be pleased with him) and gave his hair to him. Then he turned his head to the left side and asked the barber to shave it. He gave the hair to Abu Talhah and told him, "Distribute it among the people."**
Another narration Anas ibn malik narrates
“I saw the Messenger of Allah [Allah’s peace and blessings be upon him] while the barber was shaving his head [after the Farewell Hajj], and his Companions were circling around him, ensuring that a single hair would not fall except into the hands of one of them.” [Sahih Muslim]
Khalid bin Waleed took some Hairs of Prophet Muhammad peace be upon him and he used to keep those blessed hairs in every battles,It is mentioned that “I did not attend any battle except that I was given victory by means of them [ie. the blessed hairs].” (Ibn Kathir, Al-Bidayah wa al-Nihayah)
"These hairs, along with other prophetic relics, have been mentioned throughout Islamic history as being passed through the possession of various people, and migrating with them to various Islamic lands." for more visit this http://seekershub.org/ans-blog/2014/03/07/preservation-of-the-prophets-hair-and-seeking-blessings-through-it/
Allah Swt and His Messenger knows best.