How is the law of conservation of energy related to the fact that ecosystems can function as open systems?

Organisms can travel from one ecosystem to another.
Energy destroyed in one ecosystem is created in another.
Ecosystems can create energy for other ecosystems to use.
Energy that leaves an ecosystem is still conserved in a larger system.

The law of conservation of energy states that energy cannot be created or destroyed, but it can be transferred or transformed from one form to another. This law is closely related to the fact that ecosystems function as open systems because energy flows into and out of a system, but the total amount of energy in the system remains constant. In other words, the energy that enters an ecosystem via sunlight is transformed and transferred through the food chain, and some of it exits the system as heat or waste products, but the total amount of energy in the system remains constant. Thus, ecosystems can continue to function as open systems, where energy is constantly flowing in and out, while obeying the law of conservation of energy.