O really suggests "from the family", whereas Mac is specifically "son". The reason for the Dh is that feminine nouns are softened with an h which became a buailte or seimhiu, a dot over the consonant, for a couple of centuries there, then reverted back to the full letter.