What is origin of the word 'do'?

What is origin of the usage of the word 'do' when in reference to a social event (primarily in Britain)?

For example a 'Stag do' or 'Christmas fundraiser do'.


The OED says for "do" 2b:

Something done in a set or formal manner; a performance; esp. an entertainment or show; a party; hence (orig. jocular), a military engagement, raid, or other ‘show’. Orig. dial. or vulgar.