Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
My 2014 iMac 5K did it if my iPad Air 2 was not fully charged, but my 2015 model works fine regardless of how low the battery is on the iPad so maybe the USB chipset / Southbridge changed between them.
 
Sadly I had the same issue. My fix was to purchase an external USB 3.0 hub... see my thread above for the full story.

I have not had the issues since and use it every day. I connect and disconnect it regularly without any hassles

It's odd that you're using a non powered hub and it fixes it. I would think that the hub you have would still do the same since it's still pulling the same power from the iMac.
 
There are some issues with USB3.0 where the port isn't being set correctly. You can solve that by using a USB2.0 hub or cable or simply a different USB3.0 hub. This doesn't have to be a powered hub.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.