Why did Portugal explore?

Portugal used to make business with India, but the Arabian countries closed their frontiers stopping the Portuguese ships to pass. Portugal had to find another way to get there so they went around Africa. In little time they settle colonies in the continent so it would be faster. The discover of Brazil was more of a lucky shot.