If HKBH knows what is best for us, why do we pray for a particular outcome?
HaKadosh Baruch Hu (HKBH, aka God), as the midrash says, deeply desires our tefillot (prayers). Indeed our imhaot (ancestral mothers) were barren and bore children only after praying.
However, we need to understand what it means that HKBH chafetz (desires) our tefillot.
HKBH steadily bestows berachot (blessings) upon us through multiple channels. To receive and retain the berachot, we must be aware of our real needs. We should not be passive. We must have a clear purpose and priorities in our lives and be mindful of the necessity to recognize the value of what HKBH brings into our lives and use it properly. Once we fulfill this condition, we become a kli (vessel) fit to receive the berachot.
The process implies a path of reflection that involves the ratzon (will), which corresponds to the highest sefira that connects us with HKBH – Keter – which has an inner spiritual property which is ratzon.
Through the dialogue around ratzon, we create deep intimacy with HKBH. This is what HKBH wants from us – prayer. The verb l’hitpalel (to pray) is in the reflexive form in Hebrew, thus alluding to the inner reflection in which we are engaged.
These ideas are based on the writings of Sarah Yehudit Schneider. Explore her works further at the above link.