Guns are tools and tools get worn. If you use it enough it will get worn out, eventually.
That said, even SIG Sauer pistols, which have steel running on the aluminum rails, have a lifetime of 10s of thousands of rounds. By that point you’ll have spent many multiples of the pistol's cost on ammo to run through it.
Lube is good, what specific type is less important than using enough. What exact type I’d use would depend on the use. For a gun that’s carried exposed to the cold in winter, I’d use a thinner gun oil. Arizona in the summer, I’d probably use a gun grease.