When the web first was around most people had monitors that could display a limited range of colours. (256 I think). So in-turn, the web safe colour palette was introduced, hoping that the colours would display the same on all monitors.
The use of the web safe colour palette is not so important these days, as most monitors can display a lot more colours than they used to!
You may want to consider sticking to the web safe colour palette though if your designing for a new technology or handheld device.
mattevans has explained the concept of websafe colors well, though I would also add that these days a palette called "websmart" also exists which has a wider range of core colors which can be easily seen. Remember that not everyone can see colors (or certain shades) and color-blindness can be a hugely problematic issue (accessibility is paramount). Ensuring that you contrast your color choices well and taking into account that not everyone will be able to see the full range of 16million colors many devices can display, can be a pretty important issue.