If you declare victory, you are ending a war by saying you have won. Hopefully, the other side agrees, or your troops might declare you a fool. To declare is to state clearly and officially.
In elections, the government body that counts the votes declares the winner. Until the declaration is made, the results are not official. When you are traveling, you might be asked if you have anything to declare. You're not being asked for a statement of your beliefs, rather they want to know if you bought anything taxable abroad. If you hear your grandmother say, "Well, I declare!" you can be sure she is shocked and offended.