Ellen Barkin's character in Animal Kingdom, Janine Smurf Cody, was written off the show in the middle of season 3. The reason for this was not given by the show's creators, but there are some possible explanations.
It is possible that the decision was made simply to shake things up and keep viewers engaged. After all, Smurf was a major player in the show and her absence would certainly be felt. Additionally, with Smurf out of the picture, it would allow other characters to step into the spotlight and take on a more central role.
Another possibility is that Barkin herself wanted to leave the show. This could be for personal reasons or because she felt her character had run its course. Regardless, if Barkin wasn't interested in continuing with Animal Kingdom then it wouldn't make sense to force her to stay.
Of course, we can't know for sure why Smurf was written off Animal Kingdom since the creators have kept mum on the subject. However, these are two plausible explanations for what happened.