There are 2 separate concepts I think you may be trying to merge into 1.
There are File Formats (also called Container format), like Audio Video Interleave, which is commonly identified with the .avi file extension, and Matroska Multimedia Container, which is commonly identified with the .mkv file extension. They define the structure and organization of data within a file. Ex the audio data starts at offset X, the video data starts at offset Y, en_us subtitles start at offset....... etc.
Then there are Encoding Formats, like AV1, h.264, HEVC. These are algorithms that can be used to compress video for storage within a file and decompress the data within a file for display.