Vedic asura and Avestan ahura are the same word, going back to a shared Indo-Iranian root meaning lord or possessor of power, and the same is true of Vedic deva and Avestan daeva, from a root meaning shining or heavenly. What changes between the two branches is which word gets the good side. In the Rigveda even great devas such as Varuna can be called asuras as a title of majesty before the term narrows into naming a rival camp; in the Avesta the split is already total and inverted. Ahura Mazda, the Wise Lord, stands as the one uncreated god of Zoroaster's teaching, and ahura becomes the word for everything on the side of truth and order, while daeva becomes the word for the false gods and demons that Zoroastrian scripture commands the faithful to abandon.
Scholars read the reversal as a trace of an actual religious argument among communities that had, not long before, shared a single Indo-Iranian pantheon: rather than two unrelated vocabularies arriving independently at opposite meanings, one tradition appears to have kept something like the older ranking and the other to have overturned it, plausibly as part of Zoroaster's own reform against the worship of the daevas he found among his neighbors. Which direction the change ran, and how much of it predates Zoroaster himself, remains argued rather than settled among Indo-Iranian specialists; what is not argued is that the same two words, in two neighboring languages descended from one parent tongue, ended up naming opposite ends of the same moral map.