For some background, in 1990s Russian president Boris Yeltsin said to Finns, you never need to fear again. That fear came back when war started, but it became also political before the war. On December 2021 Putin stated that Finland & Sweden should not join NATO. Finnish President talked to him and noticed a change in Putin, that he was serious.
Invasion of Ukraine had not started in December 2021 yet, but it became urgent issue for Finnish President as it was seen that Finnish & Swedish NATO membership was being tied to Putin's war rhetoric at the time. Then came Finnish president's New Years remarks which was seen as a serious even in neighboring Sweden.
It's notable though that in Finland politicians have used wording "Nato-option" for decades, this conditioned the public to know what to expect if things turn sour. In Sweden NATO membership is a bit more difficult, because they didn't have such wording.
In Finland decision to joining NATO was mostly driven by sudden opinion change when war started. This opinion change was so radical that government didn't need to campaign for NATO, leadership could just focus on getting support from NATO members. Finnish and Swedish government have already negotiated with most of the NATO members so the application phase shouldn't be too hard.
Before war only ~20% favor, ~50-60% against
25.2. 53% in favor, 28% against
11.3. 62% in favor, 16% against
6.5. 76% in favor 12% against
See polling data from here: https://en.wikipedia.org/wiki/Finland%E2%80%93NATO_relations