You do not think in that detail. You just think that you are hungry and it is time for breakfast. And that attitude on the conscious level provides the proteins and carbohydrates your body needs without you ever thinking much about the real reason behind the behavior. Over the years attitudes that pass genes on to the next generation have survived as their own reward. The genes may even carry these attitudes much as retriever dogs all get the idea that retrieving thrown items is a good idea.
Terriers get the idea that digging is nifty.
These attitudes are genetically inbred. Genes that give humans attitudes that are good for reproduction of genes are likely to be passed on to later generations. Let's see how genetic advantage fits into familiar behaviors. Take the old story of Don Juan, Dona Ana, and her father. Don Juan has made love to many women.