the director is the person who brings together all the artistic elements of the film, a good script is only one element, good cast is another element, the director puts the whole thing together according to their own vision of what the film will be and so the film you see is ultimately the directors idea of what the film is and thats why the director takes the majority of the credit. the procucer finances the film and that will give them a big say in what films get made and what happens in terms of cast, crew etc, but there is resistance to letting producers take artistic control of films, thats the directors job.