Scrum Caps, Ear Protectors or Headguards have been around the game since certainly the mid 1920's. They were originally worn to protect the 2nd row's ears where they suffered from the wear and tear of crushing between the prop and hooker in the scrum, there would also be a degree of protection to the facial skin from the chafing of the front rows shorts. These original guards were usually made from leather with side straps tied under the chin.
The modern headguard is a far cry from the original product now made from modern materials and being worn by any player from 1 to 15 they have a degree of shock absorbing capability and so offer some protection against head and neck injury. The primary advantage is still that of protecting the 2nd rows ears.
There are an amazing array of different colours and styles for Headguards with some one piece with a chin strap which is held in place by Velcro right through to those with fancy lacing through the middle and over the head. In every instance Headguards must be approved by an IRB qualified test house and unless they carry the IRB marking are not allowed to be worn during games.