Originally, In the book, the rhino is actually just a normal rhinoceros that had escaped from the London Zoo, though it nevertheless was responsible for killing James' parents (with the book erroneously claiming it ate them).
In the film, the rhino appeared out of nowhere and ate James' parents, forcing him to end up in the hands of his two abusive aunts Spiker and Sponge, who used the rhino to scare James. It is unknown whether it was once a real rhinoceros when it killed James' parents or if it is just a spirit haunting James (more likely the second one since rhinoceroses are herbivores and do not eat meat).
When James and his bug friends finally reach New York City, the rhino appears and tries to slow down their progress. Slowly, it approaches the giant peach, using the power of fear. When James manages to muster up the courage to say he isn't afraid of the rhino, it weakly shoots its final lightning bolt at the giant peach until the clouds (along with the rhino) dissolve away and he dies.
Although he is the secondary antagonist, the Rhino turned out to be even more dangerous than Spiker and Sponge.