Decoding is processing written words into spoken words, including meanings, while encoding is the opposite. Decoding does not need to happen out loud; it can happen inside someone's head.
In order to decode and encode, readers need to know how words are broken up into sounds, including how small sound differences can change meaning. They also need to know the sounds each letter makes. In other words, they need to know the basics to sound out words. It is helpful if readers are able to memorize how certain words sound, so when words are repeated, readers do not need to sound it out each time.