There's also the unfortunately more common interpretation I see on reddit where somehow people believe that tax deductions are generally greater than the donated amount
This in turn allows you to take income from the charity (as an advisor/board member/fake title) so you're getting some back (with 40% taxed as income) via charity "employment".
Then as a cherry on top, you get to push headlines that you are altruistic and have buildings named after you.
Also, your friends can be advisors/board members for your charity and donate you gifts.
First you buy stock in your selected list of companies. Next you pledge suitable sums of money to charity programmes. Then you use your power and influence in ensuring said companies get all the big contracts. Your foundation is funding these programmes of course, so you can influence whom they partner with. The stocks of those companies shoot up and you profit. The funding is effectively more of a strategic investment than a donation. The tax savings are just a bonus.
Think about why Gates, who is in the philanthropy business, fought so hard to ensure Oxford don't put out their vaccine in the public domain? Oxford wanted to do so but Gates stepped in "suggesting" they partner with a well known entity like AstraZeneca instead. Of course, when you are a benefactor to an orgranisation, your suggestions tend to do more than just suggestions. AstraZeneca's terms were that they get exclusive IP and licensing rights and you know the rest.
It's a trivial matter to write the terms of the foundation such that yourself/successors can draw permanent income via "board" positions, advisory roles, or other means.