A description of the difference between MP3 and MP4 needs to start with a layperson’s understanding of what an MP3 was designed for. We are all standing on the shoulders of giants, meaning, today’s audio compression formatting would not be possible without the discovery by Alfred M Mayer of a phenomenon called Auditory Masking. According to Wikipedia, Auditory Masking occurs when the perception of one sound is affected by the presence of another sound.
MP is a shortened version of MPEG, the Moving Pictures Experts Group. An audio specific subgroup formed by a team of scientists from Germany and the United States, developed the MP 3 formatting. MP3 specifically stands for MPEG 1 – Audio Level 3. A WAV file is an uncompressed version of an MP3.
Without going into a lot of technical detail, the idea behind an MP3 is that we can reproduce a sound recording without copying all of the sounds that we are not able to detect due to Auditory Masking while still maintaining a reasonable listening quality. So; MP3 files allow us to compress a digital file to approximately 1/11 the size of its CD file from the original audio source by eliminating the sounds that we would otherwise not be able to hear. Many pure music enthusiasts would tell you they can hear the difference and avoid listening to their favourite music in MP3 format.
MP4’s are a Container Format; meaning they store different types of data, rather than being a specific type of data. MP4’s can be several different kinds of files. To understand MP3 vs MP4, use this analogy: an MP3 is an unwrapped gift sitting on a table (only one kind of media). It can only be what you see in front of you. An MP4 is a gift box, which can contain several different kinds of gifts (many possible types of media). MP4 files can contain audio and video, whereas MP3 files are for audio only.
In other words, an MP3 is a Codec whereas an MP4 is a container. I outlined what a container was above, but a codec literally translates into “code/decode” and refers to any mechanism for which a file is compressed and made playable by your computer. An MP4; being a container file can be used by different codecs.