Computer screens are measured in pixels. Images and video files have dimensions measured in pixels. They need to be the right size in relation to the rest of the page, or they will look distorted. File size can also be a concern. Users on modems have to download all the files you provide in order to make the page work.
File size has a drastic effect on that process.
You need to choose appropriate file formats that leverage the strength of the medium for your purposes. Different file formats do different things. Your choice of appropriate files for different tasks can provide you with great flexibility.