Think of a variable pitch prop a bit like being able to shift gears in a car. In other words, you can adjust the power you need. Others above have already explained how. Once tried, you'll never want to go back to a fixed pitch (writing this just landed after tooling around the mountains of southern Spain, in, you guessed it, a 172 RG with a variable pitch prop

)
One thing, though. On a standard CAA/JAA/FAA license you will need 'differences training' / 'complex endorsement' to legally fly a type with a variable pitch prop.