I'm stumped by the static issue. I've done setups like yours from several Mac laptops and an iMac and never had an issue with static.
When you say the static is "pretty much gone" when you're using the iPad mini it might indicate that the issue is with the headphone jack on your iMac. But if the static isn't completely gone I'm not sure if that's the problem.
You could try squirting some contact cleaner into the headphone jack on the iMac and plugging the mini-stereo cable into it several times to clean the contacts.
Or try switching from the wireless mouse to a wired mouse to see if interference from the wireless might be the problem. But if you still have some static using the iPad I'm not sure that would be a solution.
When you say the static is "pretty much gone" when you're using the iPad mini it might indicate that the issue is with the headphone jack on your iMac. But if the static isn't completely gone I'm not sure if that's the problem.
You could try squirting some contact cleaner into the headphone jack on the iMac and plugging the mini-stereo cable into it several times to clean the contacts.
Or try switching from the wireless mouse to a wired mouse to see if interference from the wireless might be the problem. But if you still have some static using the iPad I'm not sure that would be a solution.