The branch of biology dealing with the relations and interactions between organisms and their environment, including other organisms.