You really really need to read the hints and tips or you'll never understand this. Essentially "agam" is a contraction of "aig mi" which is "at me" and "agad" is a contraction of "aig thu" which is "at you". To say something is "mine" in Gaelic you say it is "at me" and to say it is "yours" you say it is "at you".
And then you get to things you're wearing, and that's a whole new vista of fun.
If you're on a phone and you're not getting links to the hints and tips for each skill, then you can find them here, collected on to a single page. https://duome.eu/tips/en/gd