The US is not going to defend Taiwan because of chips, but China is also not going to attack Taiwan because of chips - if they do, they'll attack it for the same reason Putin attacked Ukraine: an "us vs them" mentality helps keep dictators in power, and nothing creates such a mentality better than a war. We can only hope that China is sensible enough to see the downsides too, but the current international climate is not a real deterrent. And I have to admit China has a better claim to Taiwan than Russia to Ukraine - they never recognized Taiwan's independence, while Russia (together with the US and the UK) agreed in 1994 to guarantee Ukraine's security in exchange for it renouncing the ex-USSR nuclear weapons stationed on its territory (https://www.npr.org/2022/02/21/1082124528/ukraine-russia-put...) - and now they're "guaranteeing their security" by invading them.
Putin was popular in Russia in 2022 and his domestic enemies were weak. Putin didn't need a war to hold on to power. Wars are sometimes fought to distract from domestic problems, but that wasn't the case here. Putin has argued for more than 20 years that the Russia/Ukraine border was not determined correctly when the USSR fell and that the 1991 borders were "unfair" to Russia. Add to that Ukraine's cultural shift away from Russia, messy elections, NATO, and the belief that Russia would easily defeat Ukraine and it's pretty clear why Putin decided to invade in 2022. No reason to hypothesize alternative theories. Putin is still very popular especially among older generations despite the heavy cost of the war.