The pronunciation of "baked" is actually a special case in English.
English phonotactics do not allow /t/ and /d/ to contrast at the end of a word when there is a preceding voiceless obstruent (a sound like /k/, /p/, /f/, /s/), so the suffix spelled "-ed" is realized as /t/ in this context (and /d/ in other contexts). This is a type of neutralization, as described by user6726, and the realization of the neutralized segment as a voiceless sound can be explained as the result of "assimilation" in voicelessness to the preceding voiceless phoneme.
But /t/ and /d/ do contrast at the end of a word in other contexts in English: there is a clear difference in pronunciation, easily heard for a native English speaker, between words like "meld" and "melt", or "lend" and "Lent".
On the other hand, it is well known that in some European languages, such as standard German and Dutch, there is a "neutralization" between voiced and voiceless obstruents word-finally no matter what the preceding sound is. A typical example is standard German "Rad" and "Rat": they are considered to be homophones.
This is often treated as the result of a phonological rule that causes consonants to be recategorized as "devoiced" or "fortis" or something like that at the end of a word, although in some languages, such as Dutch or Russian, the situation is complicated by the fact that the neutralized sound may in fact be voiced, not voiceless, if it occurs in the middle of a phrase before a voiced obstruent (in the onset of the first syllable of the next word). I found a paper that talks about this phenomenon in Dutch: "Final Devoicing and Voicing Assimilation in Dutch Derivation and Cliticization," Janet Grijzenhout & Martin Krämer
Another complicating factor is that apparently, in these languages, word-final neutralization of voicing contrasts is often "incomplete" in the sense that careful measurements may reveal some kind of differences in production that are just too small to be perceived by human listeners. See e.g. "The Nature of Incomplete Neutralization in German: Implications for Laboratory Phonology," Bodo Winter and Timo Röttger. This seemed very surprising to me when I first read about it, but I believe I have read about similar cases of a mismatch between production and perception of word-initial or word-final geminate/long consonants in some languages. It's not obvious to me if this is relevant to a theoretical analysis of the phenomenon of devoicing.