The sun passes energy to the producers, then to the first level consumers eat them and get energy, and then second level consumers eat them, and then eventually it gets to the decomposers and scavengers, which put nutrients and energy back in the soil for the producers.