Trophic levels are the levels of energy transfer within an ecosystem, starting from primary producers to apex predators.