In a recent question the 2x4 transparent brick in neon green came up as a rare part (see Where to find this green transparent brick?). It doesn't seem to be listed as part of a set (at least not on bricklink) but definitely gets traded sometimes (last sale on bricklink is for $75 in Oct14). How can a brick in a specific color not be part of a set but still be available? Why would LEGO make such a piece? Anyone who can provide some insights into this?
Some of these pieces are released as collectors items (Gifts for Lego employees) or sold as novelties at LEGOLAND parks or stores pick a brick areas, others are from official Lego events (grand openings of stores, new LEGOLANDs, etc.) they are often given as gifts to people attending the events. Some are test bricks that somehow made their way out of the factory to the Lego community.
They often have unique colors or images (there is a whole series of transparent/sparkle bricks that were made as tests for new colors and manufacturing techniques.)
The LEGOLAND parks and builders also have access to parts and color combinations not available to the general public for use in making new sets, if they are not used in a set I imagine some of these could also make their way to the larger community of Lego enthusiasts.
I fully agree with the previous answer, but would also like to note that there are a few pieces that can only be found in LEGO pick-a-brick as well.