Anyone who keeps a garden is aware that many flowers actually bend toward the sun in order to catch as much of its light as they can. This is called "solar tracking," and sunflowers are a well-known example: if you inspect a sunflower in the early morning, you will find it tilted to the east; by twilight it will be tilted over to the west. So what happens if you take a sunflower out of the garden bed and keep it in a completely dark closet?
Surprisingly, even though there is no light to catch, the sunflower will continue to bend every day just as it did when it was outside. This is a classic example of what scientists call a circadian rhythm -- it's a daily cycle of behavior that is internal to the organism, rather than being solely triggered by the environment. The word "circadian" means "around one day" -- it takes roughly twelve hours for the sunflower to follow the light from east to west, and another twelve to automatically reorient itself toward the east again.
Although they do follow the sun, the fact that sunflowers continue to bend in darkness demonstrates that it is a mistake to think too literally of plants as "seeking" the sunlight. Sunflowers don't bend themselves with any purpose in mind. More accurately, we can say they have evolved over millions of years into the solar tracking rhythm because it helps catch light effectively, and the ones that catch the light best, are the ones most likely to survive. In all living things, natural selection favors those traits that result in survival; and as a result of that, we now have sunflowers that bend automatically.