Question about Foundation Donations

Often when I listen to NPR, I’ll hear something along the lines of, “Morning Edition is sponsored by the Smith Foundation. The Smith Foundation, working to improve the lives of the disabled.” I always wonder if the purpose of the Foundation is X, why is it donating to something that is clearly non-X, i.e., NPR. Are these examples of foundation officers spending their money on their own interests, rather than the Foundation’s purpose? Trying to (needlessly) raise the foundation’s profile, and thus their own profile? Or is there a more benign explanation?