How does treaty shopping work in practice?

An example of treaty shopping is set out in this video  developed by the OECD on the occasion of the launch of the BEPS Package in 2015.

As explained in the video, treaty shopping occurs when a person seeks to take advantage of a tax treaty concluded by two Contracting Jurisdictions to obtain tax treaty benefits it could not otherwise obtain. This could be the case, for example, when this person is a resident of a jurisdiction that has not concluded a tax treaty with the jurisdiction where the income arises. In the example set out in the video, Company A, a resident of the Cayman Islands, wants to provide a license for the use of intellectual property to Company C in South Africa. South Africa, however, has not concluded a tax treaty with the Cayman Islands, and would thus be entitled to apply its domestic withholding tax rate on outbound royalties. However, a European country has concluded a tax treaty with South Africa that reduced the withholding tax rates on royalties. Also, this country does not itself levy a source tax on royalties. Therefore, Company A establishes a letterbox company in this European country and diverts the royalty payments through the letterbox company to reduce the tax withheld by South Africa. In this example, the principal purpose of the establishment of the arrangement including the letterbox company was to obtain the lower withholding tax rate available under the tax treaty between South Africa and the European country.