Finland has become the 31st nation to join the North Atlantic Treaty Organisation (NATO), ending decades of military non-alignment in the Nordic countries.