The date on the painting is 1884 which is remarkable because there is so little difference between the scene then and now. What they are guarding is the old gatehouse that was the beginning of a long avenue to the Royal Residence at St James's Palace. George III moved the Residence to Buckingham Palace, keeping Horseguards as the entrance. After the completion of Trafalgar Square in 1841, The Mall became the natural approach to the palace, but Queen Victoria, who was by that time on the throne, decided to retain Horseguards as the official entrance to Buckingham palace.
The Guard rides from Hyde Park Barracks' via The Mall to the Front Yard of Horseguards. The guard is mounted every day at 11 o'clock (10 o'clock on Sunday). When the Queen is in residence, there are more men and they are commanded by an officer. This is called a 'Long Guard'. When she is not in residence, there are fewer men, commanded by an NCO and it is called a 'Short Guard'.
Horseguards is named after the soldiers who have guarded it from 1660 until the present day. Up until 1788, they were called Horse Guards, divided into 4 Troops, 1st (The King's), 2nd (The Queen's), 3rd (The Duke of York's) and 4th (The Scottish). In 1746 they were reduced to 2 Troops, which in turn were amalgamated with 2 Troops of Horse Grenadier Guards to form the 2 Regiments of Life Guards.
The original Troops of Horse Guards were not ordinary soldiers as in the line regiments, they were 'gentlemen'. The 1st Troop were originally young men of noble birth who joined the exiled Prince Charles in France. Impressed by King Louis XIV's Household troops, Charles formed his own bodyguard with these men, placing them under the command of Lord Gerard of Brandon. When Charles returned to England on 25th May 1660 he was escorted to London by the King' Troop of Horse Guards. At Charles II's Coronation on April 23rd 1661, the two Troops were described in the Mercurius Publicus as follows:
"..the King's Horse Guard, all well mounted, having Buffe coates and white armour, their Horses furnished Hooses (being short ffoot cloth [sic] ) with red scarfes and plumes of red and white feathers....the van of all was led by the Guards of His Royal Highnesse the Duke of York commanded by S. Charles Berkeley, all having black armour, red, white and black feathers, red scarfes with belts of His Highness's livery..."