Transparency can be handled differently in different formats. In GIF format, one color, usually magenta can be made not to display. This stategy is lightweight and effective for cut-out backgrounds but isn't very versatile when it comes to shading. With only 256 colors there isn't enough color depth in the format to allow for a transparent gradient. GIF is still one of the most popular formats due to its fast loading, and transparent backgorunds and the ability to store layered image data as animation frames.
Another strategy for transparency is "Alpha Channel" transparency. In this scenerio RGB data is treated as having 4 colors. A pixel has its normal color but in 256 graduations of transparency.