Compression format and compression codec are related concepts, but they are not the same thing. The compression format refers to the general method of compressing data, while the compression codec is the specific software algorithm that is used to implement that method.
For example, the MP4 format is a compression format that uses a variety of codecs to compress video and audio data. Codecs like H.264 and H.265 are specific algorithms that are used within the MP4 format to compress video data. Different codecs within the same format can have different levels of compression and performance, so choosing the right codec can have a significant impact on the resulting file size and quality.