They do not avoid capital gains taxes by doing this.
Also, more broadly, when you see a "sweeping end run around the taxation system", it may be instructive to consider why everyone else doesn't just do the same. Legal tax avoidance techniques are not secrets.