A lot of computers can only display a limited number of colors, mostly 256. Graphics which look great at 16 or 24 bit color, can look really bad at 8 bits. A lot of computers still use 256 color screens. But this is not all there is to tell. A lot of video cards use palettes.
Graphics consist of information on what color to display at a certain point in the image.
In the file that contains the image, there will be a palette at the start of the file. After that for every point in the image you'll find a reference to the palette. Thus limiting the size of the file. The palette may contain the standard VGA colors. Or any different or custom palette to render the image the best possible way.