I think you need a little bit of background information first. SWF is a vector file format, AVI and MOV are container formats (that is they are a generic container for a video, and some sound), leaving MPEG and RM (RealVideo) as the video formats left.
SWF is a wierd one. It stores data to draw shapes (for example position and colour), and optionally a timeline. These can be combined to make cartoon like images/movies.
The container formats; AVI, MOV (generally limited to Quicktime codecs), MPEG-TS (the TS stands for Transport Stream); can best be described as a package, containing compressed video, and compressed audio (seperately). The audio can be compressed with a wide range of codecs, such as MP3, Ogg Vorbis, etc, or even as uncompressed WAV. Similarly, theres a range of codecs to compress the video part, such as WMV, DivX and H.263. Any two formats (one for audio, one for video) can be used and placed in the container, as long as the container has support for it.
This is why sometimes when you try to play a video file, your software tries to download a codec to play it, because although it can read the container file, it does not have one or both of the codecs needed for the audio and video parts.
Wikipedia is your friend here:
Containers,
Video Codecs