Giving a material a nonzero ID channel number tells the renderer to generate a material ID channel containing that value. This information is stored in images only if you save the rendered scene in RLA or RPF format. However, the ID channel data is available to rendering effects at render time.