There is really no standard answer, each situation is unique. Sometimes it may be the lead producer who is unhappy with what they see. Sometimes it will be the director, or choreographer, or one of the writers who will see that someone from outside with fresh eyes is needed to fix some aspect. Sometimes you may even have a star with enough clout to bring someone new in (there were a lot of whispers going around during the last Bye Bye Birdie revival of Gina Gershon and John Stamos pressuring Roundabout to bring in someone to fix Robert Longbottom's work).
As as for who gets to decide what is kept and what is not it ultimately depends on who has the most power? Is it a well-established, respected producer working with a relatively new team of creatives? Then that producer will probably have the ultimate say. Is it a veteran director with a string of hits pulling the strings? Then that person's decisions will probably bear the most weight.