Think of it this way:
à la fin: lorsque quelque chose se termine (that's all there is to it, really)
However, "en fin de compte" is more like
après tout, au bout du compte, tout bien considéré, finalement, en dernière analyse
They are not always interchangeable, there might be a few cases wherein en fin de compte can be replaced by à la fin and vice-versa.
J'ai essayé de l'appeler dix fois, et, à la fin/en fin de compte, il a répondu.
You repeatedly tried to reach him and thought he would never pick up the damn phone! But he ultimately/eventually did. (pardon my French)
J'ai essayé de l'appeler dix fois, et, à la fin/en fin de compte, il a répondu.
à la fin is on the last attempt (you would have not tried further). It happened at the end.
En fin de compte, ça peut nous rapporter gros.
When you think about it, it could actually yield a huge profit. It's also meaning on the long run.
A la fin, ça peut nous rapporter gros.
That's like saying "à la longue" (on the long run). At the beginning maybe not, but ultimately.
Two meanings according to this link and you'll note there is à la fin amongst its synonyms. But then again, synonyms are not always interchangeable, it's context dependent.
- après tout, en dernière analyse.
- adverbe qui marque l'opposition entre deux choses liées ou entre deux aspects d'une même chose. Cependant, mais, néanmoins, toutefois.