How can foreign funding potentially shape a country's energy policy decisions?

I want to understand the mechanisms through which foreign funds might be used to influence national policies, especially in sensitive sectors like energy, and what safeguards can be put in place.