One thing is for certain, it's definitely not all cars with iDrive 5.0. My 2017 BMW i3 has iDrive 5.0 but no CarPlay.
The hardware that supports Wireless CarPlay became available for cars built in July or August, depending on which model you have. The M2, for example, was manufactured with iDrive 5.0 starting in July, 2016. However, it wasn't until August, 2016 that CarPlay was also supported. There's newer hardware in the August+ builds that enables CarPlay (both wired and wireless).
There are rumors that older vehicles that originally shipped with iDrive 5.0 (but not CarPlay) might have a retrofit option, but that is yet to be confirmed.