I learn German and I don't get it. As I know, 'an' is usually used when we say that something is near a vertical surface (das Bild hängt an die Wand). And in english, polish, russian and ukrainian we have take part in. So I wonder what's the origin of the word that caused it to go with 'an', not 'in'.
"An" is in no way limited to the meaning of the English "at" (or similar relation-to-surface prepositions in other languages). See the following examples:
an etwas denken - to think of / about something
an etwas arbeiten - to work on something
sich an etwas erinnern - to remember _ something
sich an etwas gewöhnen - to get used to something
an etwas leiden - to suffer from something
And of course: an etwas teilnehmen - to participate in something
Technically, yes, "an" has the general meaning of "being close or attached to something". But it requires some serious mental gymnastics to fit all these examples to this pattern, doesn't it?
This is why all these prepositions are part of their dictionary entries in the first place. They are mere conventions of how to use these verbs - they don't necessarily have a logical connection that could be inferred on the fly. Many do, of course, but I advise to always assume that any particular verb goes with a particular preposition by pure chance and you save yourself a lot of headaches.
-> Assume that "an etwas teilnehmen" had the same chance to exist like "in etwas teilnehmen", and the German language community simply flipped their coin differently than the English language community, without any specific reason. You have to learn the correct German preposition(s) for each verb from scratch.
If you see it figuratively, and this is what I visualize in my mind's eye, you sit AT a table with your participators. This means "Anteil haben" or "teilhaben an". See also here.
Prepositions have no logic.
Sie nimmt über Weihnachten unter Protest an einer Konferenz über Wohlstandsmüll in Bitterfeld teil.
We can only guess an is used for the meeting you attend because there may still be a place in the sentence where that meeting is held – that one gets the in. Not that it would stop us:
Im Einkaufszentrum in der Stadt gab es im September in der Feinkostabteilung schon Glühwein zu kaufen.
→ There is no logic.