This is how I'd go about build the flow.
For this example, I have the following SharePoint Lists. Note that I've just used the Title column in place of your ID A column, but would be the same concept. We can see that A-005 and A-006 are new items.

See full flow below. I'll go into each of the actions.

Get items List A retrieves all the items from List A. Note that by default Get items will only return the first 100 items, so if you have more than that you can set the Top Count to 5000 (max) to retrieve up to 5000 items.

Select extracts out the values in our Title column. You would use your ID A column here.

Get items List A Compare retrieves all the items from List A Compare.

Filter array uses values and Title from Get items List A Compare, and the Output from the Select. This will filter out only the new items that we need to update. Note the condition here is does not contain. Again, you would use your ID A column in place of the Title column.

Apply to each uses the output from the Filter array so it only iterates over the items that we need to update.

Update item uses the following expression to get the ID of the current item in the Apply to each. It then sets the Compare Value to New.
item()['ID']

If we run the flow, the Apply to each should only iterate over the last two items that are missing and update them to New.
