If we were talking about another network today, I'd agree that ratings are the driving force behind "on the bubble" shows getting the axe.
However, Disney/ABC cancels shows that have good ratings, and they don't make a real effort to build ratings for shows. They're fine with reality shows like "Dancing With The Stars," but they're clueless about series-type shows.
They overpromote new series at the expense of existing ones, somehow fantasizing that a third-season show doesn't need promotion or publicity. Scheduling is a mess: they add unannounced mid-season hiatuses and change summer shows to return in the Fall. They don't even keep their show websites current; they expect the fans to spread the word for them.
They also allow the chronic management shakeups to drive show scripting as well as cancellations. ABC Family chose to cancel Kyle XY not because of ratings - it was averaging well for a third-season show. They cancelled it because their desired network demographic group (sexually active teenage girls) didn't really watch the show. Kyle XY skewed towards an older, more educated audience, even with the gratuitous teenage sex scenes and double entendres. The network execs wanted the station to be a Destination for teenage girls, not a hodge-podge of viewing groups. That "Destination" approach works fine for the Disney channel -- my kids tune to it without even thinking. Not sure if it's working for ABC Family, though.
More importantly, Disney/ABC cancels shows without any consideration towards the viewers who've connected with a particular series. That's an insult and it has discouraged me from watching any of their series.