This is like asking what happens if two different micro-services try to make incompatible changes to the same database.
Or what happens when two different users try to make incompatible changes to the same Google Doc?
Or what happens when you try to GIT Merge a commit that has incompatible changes?
It’s your code, so it’s in your control what happens, and also in your control how to react to what you can’t control.
You can write code that avoids conflicting manipulations (let’s say all the dom manipulations only ever happen on one thread) or you can write code that handles the case... It’s a case by case kind of thing, there is no one answer.