Though certainly not the norm, occasionally some photos can come out grainy.
When an image is very dark, or very low contrast, the potential for graininess rises. In particular, when your camera is forced to boost the low light level that it captures, the image may become grainy. You may not realize this is happening because cameras generally make this boost automatically. And some cameras do this...