"As" could be roughly glossed as "when" or "while".
When we look upon a bacterium that is swimming in an environment where nutrients are distributed in a non-uniform manner, and we observe how this bacterium is moving in a purposeful way to the area where the concentration of nutrients is higher, we can deduce that the bacterium has an internal model of its enviroment.
That is, that the bacterium is able to "understand" what goes on around it, and to act based on that understanding.
"gradient of nutrients": at one side, you have the maximum concentration of nutrients. An another side, you have the minimum concentration of nutrients. And in the space between these two sides, the concentration changes gradually. This change is gradient. The bacterium swims towards the place where the concentration is maximal. It "feels" the gradient.
Here's a black-white gradient -- Imagine that there are more nutrients in the black part. The bacterium swims towards the black part to get more nutrients:
A definition of "gradient" from Merriam-Webster:
gradient (2): change in the value of a quantity (as temperature, pressure, or concentration) with change in a given variable and especially per unit distance in a specified direction