The instance names assigned automatically in the room editor are randomly generated constants.
The instance id values assigned to those named constants, that is, the id assigned to an instance that is manually placed in the room, is first based on its order in the instance order list. Then it's based on the order it was placed in the room. Yeah, that's confusing. It's been hit-and-miss trying to get it to update instance id assignment based on instance order in the room editor. It seemed like all you had to do was close the room you were working on, but that only worked once for me. Sooo...
If you create an instance in the room, it's assigned a name and the id 100001. You then create another instance in the room, it's assigned a different name and the id 100002. If you go into the instance order and move the second instance up, it will be reassigned id 100001 and the first instance will get 100002. If you run the program, then go back and rearrange the instance order yet again, there's a chance it won't change ids at all.
In other words, don't rely on the ids in the room editor. lol ... yeah I'm confused.