I'm sure many of them weren't intended as loopholes (although I suspect some were), but the simple fact is that they do turn out to be loopholes.
A few famous examples:
If you own a large chunk of a large company, of course you don't want to sell it, so you hold onto it. This means you're never going to pay any capital gains tax over it. But if you don't sell your stock, how do you get money to buy food and super yachts? You borrow it, with your stock as collateral. And you don't have to pay tax over loans, so you're still tax free. You do have to pay interest of course, but because of the collateral, interest is likely low, and as long as stock goes up, you can always borrow more to pay that interest.
Every part of this makes sense on its own, and yet the end result is that billionaires don't pay tax, and barely have to try to avoid tax; this construction would make sense even if they did have to pay tax over it.
Another: charitable foundations. Every rich person seems to have one. And because the government wants to encourage charity, they're tax free. But they're rarely real charities and they often have poor performance as charities, because that's not their real purpose. They just let you keep your money without having to pay tax over it, and the only cost is that you're somewhat limited in how you can use that money. But billionaires have plenty of money they're not actively using.
And sometimes it's also a nice vehicle for corruption, because foreign officials can also donate money to a charitable foundation.