One of the most significant hoards ever found in Scotland has been saved for the nation, having been acquired by National Museums Scotland.