How did "party" come to mean "gathering"?
Solution 1:
This is an example of how the meanings of words slide because children do not fully understand the words their parents are using and make guesses based on context.
The sequence probably went something like this:
1) A party means a leader and his followers ("The prince's party.")
2) A party means the group of followers which someone brings with him ("He arrived with a large party.")
3) A party means a group that gathers somewhere and proceeds to another place. ("Now that John was here, the whole party set out for the resturant.")
4) A party means a group of people who meet at some place and stay there. ("I am gathering a party of friends at my house tonight. Would you like to join the party?")
5) Listeners who do not know what a party is guess from context that it means "festivities".
6) A new generation starts using the word to mean a festive occasion limited to those invited.
Solution 2:
Here is the relevant part of the discussion of party in Ernest Weekley, An Etymological Dictionary of Modern English (1921):
party. Represents both F. partie, p.p. fem. of partir, to divide, and parti, p.p. masc. Usual F. senses are partie, part, parti, party, faction, but they have become much mixed in E. Sense of friendly gathering is partly due to F. partie, game, excursion, etc. Slang sense of individual, e.g. nice old party, arises from earlier leg. sense as in guilty party, i.e. side, to be a party to, etc.
So according to Weekley, three French words were influential in the emergence of party in the sense of "friendly gathering": parti meaning "faction," partie meaning "part," and partie meaning "game or excursion."
The Oxford Dictionary of Word Histories (2002) has this:
party [Middle English] The early use of party was to refer to a body of people united in opposition to others, as well as specifically to a political group. It comes from Old French partie, based on Latin partiri 'divide into parts'. The sense 'social gathering' dates from the early 18th century.
Neither Weekley nor Oxford seems at all surprised by the historical changes that saw party in the sense of a political gathering born of opposition to something expand to include a social gathering for nonpolitical purposes and from there grow to mean also a friendly gathering where hors d'oeuvres and alcoholic beverages are consumed.