A confident person knows the limits of their own abilities, but is aware of how good they still are. An arrogant person thinks they know. A confident person knows that no matter how good they are, they are still only a part of this world, an arrogant person would easily deem themselves "le roi soleil" (Louis XIV gave himself that name. Like in space everything goes around the sun, in France everything goes around me.... That was the thought behind it).
Of course when insulting a confident person and an arrogant person you may get defensive speech in return, and so people easily mix the two up. A confident person can still have dignity and underestimating them can damage that dignity. When you get into discussion with them a confident person knows they are better and an arrogant person thinks they are better. Yet (especially when the "battle" is fought on an public forum) a wise objective observer can tell the two apart, based on their argumentation.
A confident person knows that no matter how good they are, nobody owes their success on themselves. It's always the appreciation of others that make you successful, no matter how hard you work for it. If you have an election program that is foolproof to make your country an utopia, yet nobody votes for you, the plans will not be carried out. If you study to be a surgeon and no hospital offers you a job you're nowhere. If you have the talent to become the best actor, yet no film studio ever offers you a role, you'll never get a closet full of Oscars. A confident successful person will always appreciate that it were others who made them great. An arrogant person will not.