An ecosystem consists of living organisms and their physical environment. It includes producers like plants, primary consumers like herbivores, and secondary consumers like carnivores that are all connected through food chains. Within an ecosystem, species can have beneficial, harmful, or neutral relationships including mutualism where two species benefit each other, parasitism where one harms the other, and commensalism where one benefits while the other is unaffected.