This is a topic that was covered in my jss1 social studies class so I guess I can answer it well. There are a few origin stories but they all track back to two points in time. I'll arrange them chronologically.
1) the first dates back to a point where formal marriage of any form did not exist. Then marriage was done by a method called snatching or stealing. In this method, if the man could kidnap the girl and get back to his house before her family or any body intervened, she would be his wife. As simple as it sounds, it was a very difficult affair for most. So men began to work together in that aspect. A man would go to "hunt" his potential wife down with his closest of friends and their job was to fend off anybody that would try to stop him. They would do this for each other when the time arose.
2) the second origin occured in the old Roman empire. Back then, when marriage was to happen, the bride and groom were expected to come with witnesses for the wedding. Aside from serving as witnesses, the witnesses were to dress similar to the bride and groom so that they could confuse vengeful spirits or actual people that meant the bride and groom harm.