Wikipedia: A know-it-all is colloquially referred to as a person who expresses their opinion in an instructive and intrusive manner and thus gives the impression that they have more knowledge or education in certain (or in all) matters or can judge better than others.
People take offense at the behavior of such know-it-alls – not so much because they are envious of their knowledge (alleged or actual), but because they teach others uninvited, but are closed to the opinions, arguments and knowledge of other people.
This creates an air of arrogance and lack of tact. Exaggerated competitive behavior is also perceived as unpleasant by people who are discussing less out of interest in the topic than to be right.
Besserwisser literally besser, better + wisser, from wissen, to know. Better-knower.