A codec determines how the Bluetooth signal is transmitted from the source to your audio output, whether it be headphones or speakers. It encodes the data into a specific format, allowing the receiving Bluetooth device to then decode the data or audio signal. There are a number of codecs that process the data differently, resulting in various sizes and audio qualities. Some are better, some are worse, but the devices themselves also play a role in how the data gets processed (mostly in the form of latency).
SBC, The Universal Donor
SBC, or low-complexity sub-band codec, is the baseline of all Bluetooth codecs. It's certainly not the best one out there, but it's also mandatory for all A2DP-enabled devices, making it the "universal" Bluetooth codec among most devices on the market. So if there are any codec mismatches, your device will default to using SBC since it's compatible with all Bluetooth devices.
Later codecs implement higher bit rates, bit depths and frequency responses. Qualcomm, Sony, HWA Alliance, and now even Samsung have developed their own proprietary Bluetooth codecs with varying qualities. These greater rates help to preserve the data being transferred, and in the case of audio files, it transfers to higher-fidelity sound through wireless transmission.
Qualcomm was the first on the scene to develop their series of aptX codecs to offer greater quality than SBC. Though both are lossy format, aptX sounds miles better than SBC due to its higher bit rate, and in the case of aptX HD, support and compatibility with high-resolution audio files. AAC came out which allows for higher-resolution playback if you have an Apple device, as they utilize the codec as their standard. Non-apple users will find AAC to be unreliable, as most Android-based devices do not efficiently support the codec. Sony has the claim-to-fame lately with their LDAC codec, which is capable (at least on paper) of transferring high-resolution audio files. In our comparison review of the Best Noise-Canceling Headphones, the LDAC codec is one of the factors that set the Sony WH-1000XM3 apart from the rest. It produced audio quality and fidelity that far surpassed the competition.
As the technology continues to improve, and as audio files start becoming larger, we'll continue to see advancements in Bluetooth data transmission as time goes on. You can see the current specs on existing Bluetooth codecs below.