Yes. The reason why this is done is it mean that you can tell when reading the word what the word looks like without eclipsis, so 'bportán' is pronounced as if it's 'bortán' and you can tell that the original word is 'portán'. While initially confusing, it's actually a really useful feature of the orthography.
Here's more information about eclipsis: http://www.nualeargais.ie/gnag/eklipse.htm
Yes, it works similarly for c, p and t, but for b, d and g, it's more similar to the nasal mutation. Plus Welsh eclipses m and Irish doesn't have ll and rh. Some of the rules are also similar. Lenition is more similar to the aspirate mutation, even though lenition means ''softening'', so they clearly have different ideas of what softening actually is.
There are notes on it here: https://www.duolingo.com/skill/ga/Eclipsis
The gist is that when eclipsis is in effect, unvoiced sounds (f, p, t, c) become voiced (bh (v), b, d, g; which are written as 'bhf', 'bp', 'dt', 'gc' to preserve the original spelling), and voiced sounds (b, d, g) become nasalised (m, n, ng, but written mb, nd, ng to preserve the original spelling).
Now to dive deeper in to the sciencey bits.
As to why this happens, it's generally that the last letter in the previous word used to be a nasal sound, such as 'n', 'm' or 'ng'. When this final letter disappeared, it left its mark on the word that followed it.
You can see this most clearly if you look at the preposition 'i', which means 'in'. Historically, this was 'in', just like in English, but the final nasal consonant was mostly lost over time (though it was preserved when 'i' comes in front of a word starting with a vowel), so whereas once you might've said 'in portach' to say 'in a bog', now it's 'i bportach', as the nasal sound has been lost, but its echo is still seen in the eclipsis of the word that follows it.
As to why eclipsis is used with 'ag' as in 'ag an bportán', that's because technically 'pórtan' here is in the dative case (which you mostly don't have to worry about except with certain nouns as it's identical to the regular nominative case 99% of the time). The dative case is the case used with virtually all simple prepositions, including 'ag'. Where knowing this is important is with the 'an': while the nominative and dative 'an' mostly look alike in the modern language, in older versions of the language, they were different, and the dative 'an' triggers eclipsis.
To give you an example in English, once upon the time, the indefinite article was always 'an'. If English had progressed the way that Irish did, then we would have 'a' and 'an' (before vowel sounds), but you'd write 'the cat' and 'a gat', 'the boy' and 'a moy', 'the goat' and 'a ngoat'. Much the same thing happened with the dative definite article in Irish, hence 'ag an bportán'.
 A simplification, but essentially true.
 This process happened over a millenium and a half ago, back in the 5th or 6th century, back in the Ancient Irish era, so it's likely you wouldn't have said 'in portach' but something not exactly dissimilar. I don't have an etymological dictionary to check what it actually might've been based off of the Old Irish spelling, unfortunately.
ag is the basic form used with nouns, e.g, ag an gcailín, ag an mbuaichall, ag an mbean, ag an bhfear.
aici/aige is combining "ag" = "to have" with the pronoun "she" --> she has and aige is with the pronoun "he" --> he has (this is explained in detail in a later section).
In Irish most prepositions are usually written on their own, but when you use them together with a pronoun (me, you, he, she, it, us, them), the two words get contracted together to make what are known as prepositional pronouns