Two reasons why both team would do this..
This move would make the Pistons the best team in the East rn. With this trade they are in the NBA finals this year and for the next 2 years (until his contract expires) they are likely top 2,3 in the East. The Pistons are willing to give up their entire future if it guarantees them a possible ring. Now is the right moment.
Why would the Bucks do this? Ivey was the 3rd pick & Holland was the 6th pick, two young players with a lot of potential for building a new team... And the main thing is that these picks are far away and they can gamble that the Pistons will weaken in those years and that they could hit high. Giannis does not see Detroit as a desirable destination, so when his contract expires, he could go somewhere to a big market. And then the picks come...