Yes obvioiusly the pension you get in a country is related to how many years you worked
in that country. If I moved to Finland I too would get a lower pension than others when I retire in 25 years, but on the other hand I’d be getting a pension from the first 20 years of my career in my home country too. Taken together they’d (unsurprisingly) add up to the €4K or so I expect to get.
Similarly if you move there from a country with lower taxes/pensions such as the US you’d probably bring savings to compensate that you missed a number of years.
After all, these pensions based on number of years worked is often just a form of mandated savings from employers payroll taxes.