Not only bacon and eggs, in fact, all the food that we (whether vegetarian or non-vegetarian) eat is based on photosynthesis. This is the process by which chlorophyll-containing green plants convert sunlight into food. The process also consumes carbon dioxide and water and yield glucose along with generation of oxygen. Photosynthesis can be summarized by the following chemical reaction:
`6 CO_2 + 6 H_2O + sunlight -> C_6H_12O_6 + 6 O_2`
Glucose molecule is then used for either generating energy (through cellular respiration) or for making higher molecules (for plant growth, which requires energy generated from cellular respiration). Animals consume the plants and use that food to generate body mass and energy for maintenance and growth. These primary consumers may be eaten up by secondary consumers and so on. The meat that we eat (such as bacon) and other animal products (including eggs) are thus an end-product of the photosynthesis and hence are dependent on it.
Hope this helps.