Knowing the four conjugations is useful, but is not sufficient to figure out the full paradigm of a verb. For example, some third-conjugation verbs form their perfects with -s- (dixī), others with reduplication (cucurrī), others with vowel changes (ēgī), and so on. Historically, these go back to a few different constructions in Proto-Indo-European that fell together in Proto-Italo-Celtic (or Proto-Italic and Proto-Celtic if you prefer). So there's no reliable way to predict which one a given verb will use.
So the standard way to learn a Latin verb is to memorize four principal parts:
- The first singular present active indicative, which is the citation form used to talk about the verb
- The present active infinitive, which tells you the conjugation, and thus tells you how to conjugate the present system; cut off the ending to get the "present stem"
- The first singular perfect active indicative, which tells you how to conjugate the perfect system; cut off the ending to get the "perfect stem"
- The supine or perfect passive participle, which is usually predictable from the perfect stem but not always
The two verbs you're talking about are
- edō, edere (or ēsse), ēdī, ēsus
- ēdō, ēdere, ēdidī, ēditus
And as you've seen, you need to know the third principal part to conjugate them in the perfect system; there's no reliable way to predict it from the other parts.
As for why they're like this, historically…
Edō is pretty regular, except for a couple weird present forms (which come from it being an athematic verb in Proto-Indo-European). It forms its perfect stem the same way as agō~ēgī, which is not unusual for the third conjugation.
Ēdō comes from ē- "out" plus dō, dare, dedī, datus "give". In the history of Latin, short vowels in medial syllables (i.e. not the first or last syllable of a word) got reduced, so *ēdare regularly became ēdere, and *ēdatus became ēditus. Synchronically, though, ēdō forms its perfect stem through reduplication, which is also not unusual for the third conjugation (compare currō~cucurrī).