IAC opens an extra air passage in throttle body during cold start conditions, and closes it off once engine warms up.
when it's starting to go bad, the valve does not close off this passage, and you get low-rev sputtering/backfiring and sometimes 2000+ rpm cold idle. at higher revs even with iac pooched, engine runs fine.
there's an electrical terminal test outlined in Haynes manual to check the valve's operation. informal check is to pull the IAC once motor is warmed up...motor off. have your beautiful assistant turn key to ON posisiton (but not start engine) and if the rubber plug on end of IAC motor doesn't extend, it's pooched.
IAC failure is fairly common on high-mile 2.5 engines, enough so that used parts places rarely have em in stock. new one is $250, sorry for bad news!