For Portugal the local history explains that it all started because the reconquista had nowhere to continue to. Without the reconquest of land from the Muslims of the Iberian peninsula, the local catholic kings saw themselves locked out of pillage and expansion. On one side the sea, and in the other European super powers.

Portugal started the discoveries by conquering Ceuta. I cannot find a better source than this [1] but the attack of Ceuta and thus the start of the discoveries was kind of pure pillage driven with the religious justification as a backdrop. Portugal had just recovered from the black plague and a new monarch dynasty just came into power. Things were ripe. To attack Ceuta, the portuguese needed to invest imensly in ships and ship craft. From this investment and the success of the ceutan campaign it became an obvious advantage to continue persuing naval superiority, the rest is history.

Mind you that the kingdom of Portugal was very scared of projecting itself as a threat to the other European powers and it especially needed to assuage the English that such naval power was not to be employed against them. The portuguese kings were quite aware they would not be tolerated in the great European game. So there was really not much choice than trying something new, and it paid off.

I sometimes think that we live in such a similar times regarding space exploration. Whoever gets the logistics and trade stations of asteroid mining and spaceborne manufacturing right will be a new "naval power" with access to massive amounts of resources. Leaving the local earth powers bickering with each other.

So to the first question, Portugal was around Asia because it was too small to compete with the European powers, Spain likewise. So they turned away from Europe, saw the opportunity and literally split the world in half. The territories to the west of around cape verde were to be Spanish and the ones to the east portuguese. This was defined in the treaty of Tordesilhas[2]. The reason that Brasil became a portuguese colony is by luck(dude Bartolomeu Dias expects to find the way to India and instead lands in brasil. Sheer luck and risk taking.

Finally to show the irony of history, Portugal lost its independence to Spain due to ridiculous circumstances. The first thing the Spanish did with the United portuguese and spanish armada was to use it to unsuccessfully blockade England. Exactly what the enterpreneuring kings did not want and feared. When Portugal recovered its independence it no longer had the naval power to maintain its vast trading network, barely recovering Brasil from the Dutch. Other territories in Asia, especially around the Malaca strait were no longer sustainable. Even so besides Brasil, the portuguese presence overseas was very coastal and limited Precisely because it did not have the size nor tech for full on land presence. Again brasil was special, and probably Brasílians in HN can give you a better more accurate perspective. These dudes called bandeirantes would be given lots of power over any new land discovered, so human greed and need carved one of the largest countries in earth. The inland mapping and presence of the portuguese territories, with the except of Brasil, only started around the 1800s but by then England was already a major super power and she literally would declare war if the portuguese continued claiming the Land between Angola and Mozambique, which clashed with the English ambitions of Cairo to cape Town connections.

[1]https://observador.pt/especiais/ha-600-anos-ceuta-ha-500-afo...

[2]https://en.m.wikipedia.org/wiki/Treaty_of_Tordesillas