I've tried to look for it and I found out a strange result:
The first word should mean opportunity, but if I'm not wrong its etymology comes from "to lie".
Is this correct?
German Language Stack Exchange is a bilingual question and answer site for speakers of all levels who want to share and increase their knowledge of the German language. It's 100% free, no registration required.Sign up to join this community
Even though Emanuels answer pretty much says it all, I looked it up on dwds.de:
mhd. gelegenheit 'Art und Weise, wie etw. liegt, Lage, Stand (der Dinge), angrenzendes Land', in frühnhd. Zeit dann (wie Lage) die 'Verhältnisse, in denen sich jmd. oder etw. befindet'
Which roughly translates as
Middle High German gelegenheit 'the way something lies, location, status (of something), bordering country', later in Early Modern High German 'circumstances, someone or something is in'
But even more interesing is the verb
mhd. gelegen 'benachbart, zur Hand, passend, verwandt'
Middle High German gelegen 'neighbouring, at hand, conventient/suitable, related
So something that is
gelegen is something that is convenient. So
Gelegenheit could be a situation that comes is convenient/suitable.