its the Cavs getting their OWN pick back. Portland has Cleveland's 2018 pick as part of the Varejao/Frye deal.
the Cavs reaquired their 2018 pick for their 2017 pick.
doing this allowed the Cavs to deal their 2019 pick to Atlanta. If not- they would have only been eliglbe to trade a 2020 pick- since you cant not have 1st round picks for 2 consecutive years.
So- all Portland did was get Clevelands 2017 first round pick for Clevelands 2018 first round pick.
The Cavs benefited because this allowed them to have the 2018- thus being eligible to deal the 2019.
Instead of having picks in 2017, and 2019- they just have their pick in 2018.
In other words, they did each other a solid. Just like @wildturkey already said.