Because Russian's war with Ukraine is unsustainable, something has to change for Putin for him to remain in power, and one option is an escalation with NATO. Some other scenarios also explained in this good video https://m.youtube.com/watch?v=jDhYFSGkaAc
Also, how's Ukraine war is sustainable for Ukraine? It's economy is non-existent (almost 100% dependent on western donations), it has less than 50% of population of 2022 (they don't publish any population stats directly, but if you combine available statistics, there are about 10-15 millions left most of them old retired people or young people that are too young to send them to the front lines), they are losing territory every day.
This is some weird "Ukraine is winning but front is moving in the wrong direction" logic.