The geography and topography of glacially carved, mountainous Norway constrain both the sea and the land routes which an aggressor must follow.
In the age of black powder, cannon allowed breaching of the fortress walls and subsequent taking by storm.
Most Norwegian fortresses were constructed in the period of intense competition among the Baltic powers (Denmark-Norway, Sweden, Russia, Poland and the German states) for northern supremacy.
Hence the naval trading powers, particularly Holland and England, contributed to the Northern unrest of the period.
As one example, the danger of French domination under Louis XIV resulted in a 1668 triple alliance of England, Holland and Sweden.