To expand, these are what we call replacement effects. When they trigger at the same time the player who controls the action that triggered them decides what order they are applied.
For this example the order doesn't matter, but it can easily mean the difference between winning and losing in some games.