In 1939, the Soviet Union signed a Non-Aggression Pact with Germany that cleared the way for the invasion and Fourth Partition of Poland. (Most people forget that 1922-39 Poland held half of Belarus and a large chunk of northwest Ukraine. The USSR took this, right up to the Brest-Litovsk line, in 1939, and never surrendered it. A secret clause of the Pact gave the USSR a free hand in Latvia and Estonia, with Lithuania falling in the German sphere of influence.
At the same time, Stalin made significant territorial demands on Finland – which extended within 25 miles of Leningrad at the time. In exchange for this, the original proposal would have given Finland a significant chunk of Russian Karelia. (Basically, it was, take the meandering roughly north-south Russian-Finland boundary – give us (USSR) land at the north and south, and we’ll give you some in the middle.) The Finns rejected this and commenced the Winter War (winter of 1939-40) – in which the Finns made a surprisingly good showing, leading Stalin to beef up his army. Eventually the USSR won, and got its territorial concessions (without the proposed Karelian exchange land). This was the war in which the UK debated whether to back the Finns.
For the record, Norway was neutral – but Germany was using that neutrality to buy high-grade Swedish iron ore from the Finnmark ore fields in northernmost Sweden – Kiruna and Gallivare. While in summer the Swedes could ship this out through the port of Lulea, on the Gulf of Bithynia, that was frozen much of the year, and shipments went to Narvik in Norway, which was, if not precisely ice-free, navigable year round. Churchill (then First Lord of the Admiralty) observed that blocking Swedish ore shipments would severely cripple German armaments production – especially with Lorraine behind the Maginot Line in hostile France. Since British sympathy for the Finns as free and underdogs defending themselves from the Soviet menace (the common view, whether or not true) required access to Finland, the idea of getting there through northern Norway therefore killed two birds with one stone in his mind.
After Hitler invaded the Soviet Union, the Finns launched the “Continuation War” in 1941 – which was ended in 1944 by an effective status quo ante bellum armistice later turned into a treaty – one of the few the USSR kept punctiliously. Finland remained a free nation ostentatiously neutral and officially almost pro-Russian during the Cold War years – something that has caused some internal debate since.
Big picture: Britain (and France) wanted to help Finland against a USSR allied with Hitler. After Hitler invaded the USSR, the latter became our ally, and Finland therefore our enemy de jure, though Mannerheim (Finnish President) and Churchill had an understanding that there would be little or no actual fighting, the “state of war” being something the UK needed to do officially to support its ally the USSR.