By large-but-immaterial, do you mean the money escaped via tax fraud and illegal tax cuts?
In your example on Apple this is not clear at all: there are two legal systems at play (the Irish one and the EU one). Apple is only playing by the rules of the Irish one. The problem comes from the EU saying that the Irish laws are not within the EU framework and thus not allowed.
Apple is very much doing not legal things from a perspective of EU law, hence the fine.
These treaties by the way, are passed with popular consent. As a constitutional democracy Ireland requires a Referendum for any constitutional change, which is always necessary when signing up to anything that says we'll conform to some outside agency.
Parent was the one making definitive claims about fraud and illegal actions.