Yes studios look for ratings. But ratings by themselves are not the only reason a show is or might be cancelled.
There was a show some years ago about the future and timelines (can't recall the name of it), and the ratings for that show were insanely highly for a brand new show but the studio cancelled it after its mid-season finale. The show didn't even get a full season.
Why was it cancelled? No one knows.
Yes and they are keeping Naruto going because while it may no longer have high ratings it used to have. It's still giving them more money than they would get if they cancelled it. They are also keeping the anime alive hoping the bolt manga will hopefully be a success and revive the now declining franchise. A lot of shows end after there first season because producers don't think it will be successful whether or not it has high rating. It ultimately up to the producers of a show to decide whether or not to keep a show going or cancel it. SP and SJ want the anime to continue because they hope to then springboard onto the bolt anime. So they are using these filler to keep the Naruto anime going until they are ready to go onto the Bolt anime.