When it comes to format, what we highlight is the codec. The significance of codec is to compress your files, lossy or lossless.
The container is just like a box that can contain multiple video and audio streams, subtitles and metadata. And it's usually called as file extension. Each video file (encoded by whatever codec) uses a container format to encapsulate the encoded multimedia content. Find more details