Why are Portuguese migrating out of Portugal? Where the world's population is growing and shrinking

Apart from a low fertility rate, why is the Portuguese population declining?
As you write, fertility rate explains most of it, and immigration explains the rest.

People tend to migrate to richer countries, and Portugal is below average EU income. (Portugal is an EU member. The EU has freedom of movement, the citizens of any member state can relocate to other member states and work there.) Real per capita GDP is 30% less than in its neighbor Spain, and almost 50% less than in Germany.

Eurostat Real GDP per capita table