The Second India Armada, commanded by Pedro Álvares Cabral, had arrived in Portugal in the summer of 1501 in a terrible shape.
Ship and human losses were tremendous, its mission objectives failed.
They had failed to establish a factory in Sofala, the outlet of the Monomatapa gold trade in East Africa, and, more worrisomely, opened hostilities with the city-state of Calicut (Calecute, Kozhikode), the principal commercial entrepôt of the Kerala spice trade and dominant city-state on the Malabar coast of India.

By the time this news was received, the 3rd India Armada under João da Nova had already departed, a commercial expedition unequipped to deal with the hostile turn of events in the Indian Ocean.

As a result, King Manuel I of Portugal ordered a new fleet to be assembled, the 4th India Armada, armed to the teeth, with the explicit objective of bringing Calicut to heel.

The command of the 4th Armada was offered to Pedro Álvares Cabral.
But various factions in the Portuguese court and the Casa da India, opposed Cabral's appointment, on the grounds that it was Cabral's 'incompetence' that had created this unhappy situation to begin with.
However, Cabral had his own political supporters  that could not be ignored.
The king tried to compromise by offering Cabral the position of captain-major (capitão-mor), but letting it be clearly understood that his command of the fleet would not be absolute, that at least one squadron would be placed under the separate command of Vicente Sodré (an uncle of Vasco da Gama, and leading opponent of Cabral).
Finding this condition an unacceptable affront, Cabral withdrew his name in a huff.
Manuel I immediately appointed Vasco da Gama himself as captain-major.

The intrigues behind the appointment have been variously told.
By some accounts, the initial offer to Cabral was a pro forma gesture to palliate his faction rather than an earnest offer.
In other words, the king never had any intention of letting Cabral lead the expedition, that the onerous conditions were introduced knowing Cabral  would find them unacceptable.
That these conditions were only revealed at the last minute, just before the fleet's departure, lends credence to the theory, i.e. the monarch did not want to give Cabral time to reconsider or allow opposition to mount against Gama's rapid appointment.

Chronicler Gaspar Correia tells a slightly different story – he does not mention Sodré's command, but rather relates how King Manuel I summoned Vasco da Gama a mere three days before the scheduled departure date and expressed his "disappointment and mistrust" of Cabral's "dubious fortune" at sea.,
but that he had made a promise to Cabral and could not break it.
 On this hint, Gama produced a royal letter (issued by Manuel back in 1500, and reiterated in October 1501), promising Gama a determining role in any future India expedition, and demanded command of the expedition for himself.
The king was caught between two commitments – honoring the letter to Gama, or his appointment to Cabral.
Hearing of the king's quandary, Cabral voluntarily withdrew his name to graciously allow Manuel I to honor his letter.

The 16th-century chroniclers seem to agree that King Manuel I wanted to deprive Cabral of command, and that the Sodré appointment and/or the Gama letter was just a ploy by the king to wiggle out of appointing Cabral.
 But some later authors have interpreted the accounts differently, that King Manuel I was wholly behind Cabral, but was forced to yield to the unsavory machinations of the Gama-Sodré family.

Just before his departure, in a solemn ceremony at the Lisbon Cathedral on January 30, 1502, King Manuel I bestowed upon Vasco da Gama the newly created title of Almirante dos mares de Arabia, Persia, India e de todo o Oriente ("Admiral of the Seas of Arabia, Persia, India and all the Orient") - an overwrought title reminiscent of the ornate Castilian title borne by Christopher Columbus. (
Evidently, Manuel must have reckoned that if Castile had an 'Admiral of the Seas' running around, then surely Portugal should have one too.)

On a
The Second India Armada, commanded by Pedro Álvares Cabral, had arrived in Portugal in the summer of 1501 in a terrible shape. Ship and human losses were tremendous, its mission objectives failed. They had failed to establish a factory in Sofala, the outlet of the Monomatapa gold trade in East Africa, and, more worrisomely, opened hostilities with the city-state of Calicut (Calecute, Kozhikode), the principal commercial entrepôt of the Kerala spice trade and dominant city-state on the Malabar coast of India.
By the time this news was received, the 3rd India Armada under João da Nova had already departed, a commercial expedition unequipped to deal with the hostile turn of events in the Indian Ocean.
As a result, King Manuel I of Portugal ordered a new fleet to be assembled, the 4th India Armada, armed to the teeth, with the explicit objective of bringing Calicut to heel.
The command of the 4th Armada was offered to Pedro Álvares Cabral. But various factions in the Portuguese court and the Casa da India, opposed Cabral's appointment, on the grounds that it was Cabral's 'incompetence' that had created this unhappy situation to begin with. However, Cabral had his own political supporters  that could not be ignored. The king tried to compromise by offering Cabral the position of captain-major (capitão-mor), but letting it be clearly understood that his command of the fleet would not be absolute, that at least one squadron would be placed under the separate command of Vicente Sodré (an uncle of Vasco da Gama, and leading opponent of Cabral). Finding this condition an unacceptable affront, Cabral withdrew his name in a huff. Manuel I immediately appointed Vasco da Gama himself as captain-major.
The intrigues behind the appointment have been variously told. By some accounts, the initial offer to Cabral was a pro forma gesture to palliate his faction rather than an earnest offer. In other words, the king never had any intention of letting Cabral lead the expedition, that the onerous conditions were introduced knowing Cabral  would find them unacceptable. That these conditions were only revealed at the last minute, just before the fleet's departure, lends credence to the theory, i.e. the monarch did not want to give Cabral time to reconsider or allow opposition to mount against Gama's rapid appointment.
Chronicler Gaspar Correia tells a slightly different story – he does not mention Sodré's command, but rather relates how King Manuel I summoned Vasco da Gama a mere three days before the scheduled departure date and expressed his "disappointment and mistrust" of Cabral's "dubious fortune" at sea., but that he had made a promise to Cabral and could not break it.  On this hint, Gama produced a royal letter (issued by Manuel back in 1500, and reiterated in October 1501), promising Gama a determining role in any future India expedition, and demanded command of the expedition for himself. The king was caught between two commitments – honoring the letter to Gama, or his appointment to Cabral. Hearing of the king's quandary, Cabral voluntarily withdrew his name to graciously allow Manuel I to honor his letter.
The 16th-century chroniclers seem to agree that King Manuel I wanted to deprive Cabral of command, and that the Sodré appointment and/or the Gama letter was just a ploy by the king to wiggle out of appointing Cabral.  But some later authors have interpreted the accounts differently, that King Manuel I was wholly behind Cabral, but was forced to yield to the unsavory machinations of the Gama-Sodré family.
Just before his departure, in a solemn ceremony at the Lisbon Cathedral on January 30, 1502, King Manuel I bestowed upon Vasco da Gama the newly created title of Almirante dos mares de Arabia, Persia, India e de todo o Oriente ("Admiral of the Seas of Arabia, Persia, India and all the Orient") - an overwrought title reminiscent of the ornate Castilian title borne by Christopher Columbus. (Evidently, Manuel must have reckoned that if Castile had an 'Admiral of the Seas' running around, then surely Portugal should have one too.)
On a 
4th Portuguese India Armada (Gama, 1502)