The concept of Web Safe Colors was invented by the creators of Netscape. Netscape was one of the earliest, most successful web browsers. Before and during the early versions of Internet Explorer, Netscape was far and away the most popular and widely used browser.
When Netscape was released, it came with a fixed color palette of 216 colors. This was done because many machines on the internet were only capable of rendering 256 colors. 216 was chosen because many computers reserved 16 to 20 colors for their own use, and 216 allowed 6 shades of red, 6 shades of green, and 6 shades of blue (6 x 6 x 6 = 216).
Any colors outside of those 216 colors would then be approximated using a combination of the 216 colors in the palette. This process is called "dithering." The design goal was that if people stuck to the 216 "web safe colors", their web pages would never be dithered by anyone using Netscape.