The custom of Trooping the Colour dates back to the time of Charles II in the 17th C when the Colours of a regiment were used as a rallying point in battle. The Colours are the flags which were carried into battle by different regiments, these flags were the rallying point of each regiment and in order to ensure that each soldier could recognise their own Colours the flag was carried (trooped) in front of them every day. In London, the Foot Guards used to do this from 1755 onwards as part of their daily Guard Mounting on Horse Guards and the ceremonial of the present parade is along similar lines. In 1805 the parade was carried out for the first time to celebrate the Sovereign's birthday.
If you have access to YouTube, you can watch this video:-
If you want to know more about it's history visit this web site all about Pageantry.