It's all about how the bike is stored and the conditions it's ridden in.
I have a 40 year old bike that was stored indoors and ridden sparingly. When I overhauled it a few years ago, nothing was seized.
I've seen bikes in a saline environment (sea spray or smart trainer) with outrageously corroded bolts after a year or two.
Like the guy above me said, a dab of whatever you have handy. It's probably not a terrible idea to basically disassemble and reassemble your bike every few years. Back in my heyday, I'd often replace cables after a single rainy ride.