For example, let's say I import a file with the following objects:
<a id="1010_2_" xlink:href="#">
<path class="st1" d="M68.929,0.045v5.212c4.221,0,7.642,3.421,7.642,7.641h-7.642v0.832h6 .611v103.806h-1.229h-0.253l-0.022-7.526 h-0.833v7.642c-3.032,0-5.545-1.662-6.78-4.224c-1.256,2.498-3.922,4.22 4-6.907,4.224v-7.642h-0.924v7.525l-0.135,0.001H0V0 L68.929,0.045z"/>
When I save in Illustrator, it does this:
<a id="_x31_010_x5F_2_x5F_" xlink:href="#" >
<path class="st9" d="M68.929,0.045v5.212c4.221,0,7.642,3.421,7.642,7.641h-7.642v0.832h6 .611v103.806h-1.229h-0.253 l-0.022-7.526h-0.833v7.642c-3.032,0-5.545-1.662-6.78-4.224c-1.256,2.4 98-3.922,4.224-6.907,4.224v-7.642h-0.924v7.525 l-0.135,0.001H0V0L68.929,0.045z"/>
Not sure what you expect. ID's are completely arbitrary and as soon as you change anything in AI, it recalculates/ reassigns them following its own internal logic for element IDs. That's just the way it is.
Please disregard my confrontational tone if you meant "Not sure what you expect" in a way that isn't condescending, but, since it sounded that way:
What kind of answer is "That's just the way it is"? That is, I don't expect every question to get answered, but if you're going to respond, I'd ask that it be with something useful, not just "Oh, well, that thing that doesn't make any sense? That's just the way it is." If you don't know/have something to add, not answering would be preferable to answering with "Not sure what you expect."
I'm going to assume that you don't really know anything about using SVG's in web design (or you wouldn't have claimed that IDs are "completely arbitrary"), so I'll fill you in. When you're styling or scripting with SVGs, IDs are how you access objects (paths, groups, etc) in the SVG. If Illustrator is mangling them, that makes my life a bit tougher. I'll just have to run all of my SVGs through a script that does a find/replace for those strings, but still, I shouldn't really have to do that.
I expect Illustrator to not recalculate/reassign them for no apparent reason, when they're rather important. If it's exporting an SVG for the first time, sure, it can make up whatever IDs it wants. When I've edited them elsewhere, though, and imported that (completely valid) SVG file into Illustrator, there's no reason it should be reassigning ID's arbitrarily.
I kind of understand what it's doing with the underscores. x5F is the hexadecimal ascii code for "_", so it would seem that it's hex-encoding special characters. I'd rather there be an option to disable that, but it is what it is. What confuses me is the 1, though. Why would it need to hex-encode the number 1?