Energy in an ecosystem is mainly made by the producers of an ecosystem. The net primary productivity in an ecosystem depends on many factors. Some of them are:
Amount of sunlight: The amount of sunlight that the plants and trees might be has basic influence on the primary productivity. Plants and trees receiving enough sun light will be able to make more food for organisms living in that area as compared to the producers which do not receive enough sun light.
Soil texture: The soil texture and the availability of nutrients heavily influence the primary productivity of an ecosystem. An area having a soil texture with not enough nutrients will not be able to grow more plants. As a result, the productivity would decrease.