A Bluetooth audio codec is the algorithm used to compress and transmit audio wirelessly. Higher-quality codecs like LDAC and aptX HD enable near-lossless sound over Bluetooth.
When audio is transmitted over Bluetooth, it must be compressed to fit within the wireless bandwidth. The codec determines how much quality is lost in this compression.
Common codecs ranked by audio quality: LDAC (Sony) supports up to 990kbps and 24-bit/96kHz, which is the highest quality available. aptX HD (Qualcomm) supports up to 576kbps and 24-bit/48kHz. aptX supports up to 352kbps at CD quality. AAC supports up to 250kbps and performs well on Apple devices. SBC is the baseline codec at up to 328kbps and is the most compatible but lowest quality option.
Both the source device and the headphones must support the same codec to use it. An iPhone sending audio to LDAC headphones will fall back to AAC because iOS does not support LDAC transmission.
In practice, the difference between AAC and LDAC is most audible on high-end headphones with high-quality source material. For casual listening or podcasts, SBC and AAC are entirely adequate.