This is a closed terrarium ecosystem. The plants provide oxygen for the animals and the animals produce CO2 for the plants to use. The water evaporates and comes down again as "rain".
10 Best Animals & Insects For A Closed Terrarium
Go Tropical! Setting Up a Rainforest-Style Terrarium
Life in a Terrarium Animals & Nature Jigsaw Puzzles