The given example suggests the principle of resource partitioning.
The resource partitioning is a method of division of resources present in a particular niche to avoid the competition. In this case, the organism divide the regions having the abundant resources and they do not interfere in each others region.
In this case, the resource partition takes place by dividing the regions in the flask. one species use he resources present in the middle region and other uses the resource in the bottom.