tvbythenumbers compiles data from Nielsens ratings and then compares shows with other shows on the same network since that's a big factor in determines what lives or dies. Networks usually start at the bottom of the list and axe the weakest shows (there are some mitigating factors such as airing on Fridays.)
Based on recent Nielsens, it doesn't look to me like Castle
is one of ABC's top rated shows, or else it would be higher on the list. Maybe this is a recent development as of S5 and the show just came back to much weaker numbers, but that doesn't change the numbers, maybe the show is just out of steam.
Shows that drop in the ratings rarely come back up, but it's all relative and ABC's freshman class this year is not doing too well. If their new shows keep dropping, then that could change things before ABC makes any decisions about what to axe this season.
For instance, the list has just been updated
moved up a notch due to 666 Park Ave
dropping even more. Still not far up enough to be safe, but ABC can't be feeling very cocky nowadays so maybe they'll renew it because it's a known quantity. Or, ABC could move it to Fridays, which is a good night for low rated shows with a loyal fanbase, works for Grimm
The comments section at the link above discusses more factors like syndication that will influence the decision, although I can't vouch for the reliability or rationality of the tvbythenumbers crowd.