Energy flows through ecosystems as photosynthesis and cellular respiration are connected processes. Photosynthesis uses sunlight to produce sugars from carbon dioxide and water in chloroplasts, the sites of photosynthesis in plant leaves. Cellular respiration takes place in mitochondria and uses oxygen to break down foods, releasing energy stored as ATP. The respiratory system supports this process through gas exchange.