When this guy (Grand Duke Cosimo I de' Medici) tells you to build something, you make sure it happens. So, when the Duke asked Giorgio Vasari to build a walkway for him so that he could travel to and from the Palazzo Pitti and the Palazzo Vecchio without encountering everyday people, Vasari worked quite quickly.
In 1564 Grand Duke Cosimo I was the absolute ruler of Tuscany, and because his monarchy replaced the Florentine Republic, he was a bit skittish traveling in public. But when you're a Grand Duke, you can work around little inconveniences like that by having one of the most talented architects in Europe design and build a passage especially for you and your family to travel in safety.
Though the ability to move freely between the seat of government and the main residence was the main reason for building the corridor, the Grand Duke and Vasari wanted to make sure the trip was a pleasant one. So, the corridor was built along the fascade of Santa Felicita, and a gallery was made inside the church so that the Ducal family could attend services more-or-less in private. Another modification caused by the corridor was the eviction of the meat market on the Ponte Vecchio. It seems that Cosimo I didn't like the smell of raw meat, etc. that typically came with a meat market, so he had them evicted and gold merchants moved in, which is what you'll find along the bridge today.
Inside the corridor today there are over 1,000 paintings. Many are religious subjects, but the vast majority are portraits of various personalities from the time of the Grand Duchy. Normally the corridor is closed to the public, but after being renovated in the 70s, small groups can sign up for guided tours at (seemingly) random times of the year.