More than 3 billion years ago, on an Earth entirely covered with water, photosynthesis first evolved in ancient bacteria. In the following millions of years, those bacteria evolved into plants, optimizing themselves along the way for various environmental changes.