It is based on atomic number, which is the number of protons in the nuclei of the atoms of an element.
When plants die they become food for the decomposer for example Lettuce, If all the Lettuce in someones field died the decomposer would get its nutriets and make the soil stronger, so if you plant more Lettuce and it survives the Consumer would get to eat the lettuce. Hope this helped! :)