The AI doesn't really justify its name when it comes to the pitting issue. It seems that there's no real implementation of 'ekeing out' tyre life for the AI cars. Where you or I would try to conserve tyres as much as possible, the AI cars just go for it, and as soon as they get to a wear point, they pit. There's no race strategy to it, and that's why you see a car pitting on the last lap. It's a bit pointless.
With some of the races, I've had to watch myself, because a ar hass roared off into the distance, and I've tried to give chase, but then it pits like every 3 laps, and so comes last. The Cobra in the Seattle Enduro is a prime example of this.