I would say that smugness has almost nothing to do with knowledge, and everything to do with attitude.
I have seen people being smug that they know nothing about a given subject.
That is smugness is almost exclusively about “thinking you're better…”.
If someone thinks they have more knowledge, or thinks they have achieved more; it is easier for them to become smug in that belief. People can also become smug even if they know that neither is true.