An organism's particular role in an ecosystem, or how it makes its living.