Typically a producer has a big involvement in to how a finished song or album is going to sound. In terms of hierarchy in the studio, the producer has the most power.
Within this role the producer is in charge of various different aspects in the studio. For example this can involve creating ideas, mixing or overseeing someone else mixing, hiring session musicians and working with a sound engineer to make sure the best sound in produced.
An example of a famous producer would be Dr Dre. Dr Dre is responsible for co producing Eminems Marshall Mathers LP as well as being the executive producer for The Eminem Show and Encore.