When you export a diagram to SVG, yEd presents you with several export options. One of these is "Export Description as Tooltip" on tab "Links and Description".
If "Export Description as Tooltip" is checked (which it is by default), additional content is added to the generated SVG document that handles displaying the desired tooltips.
If you uncheck "Export Description as Tooltip", no additional content is added.
I think so far the behavior is straight-forward.
The actual approach for realizing tooltips in SVG documents is over ten years old. As a result, it is certainly not as simple and/or as elegant a solution as nowadays possible - but it serves its intended purpose.
Yes, without support for tooltips neither JavaScript nor IDs are necessary.
Yes, both the JavaScript and the IDs are intentional when "Export Description as Tooltip" is checked.
That said, the really bad news is this:
Your workflow is inherently broken! The IDs in GraphML files are in no way related to the IDs yEd generates for tooltip support in SVG document. They might "match" by accident and by accident only. The reason for this is simple: GraphML IDs simply do not exist while a graph is loaded in yEd.
Unfortunately, yEd offers no reliable way to match GraphML elements to corresponding visual representations in an SVG document. In this regard, yEd treats SVG export similar to raster image export.
Even though yEd does not support your desired workflow, using the yFiles diagramming library it is possible to add meta data to GraphML files and SVG documents (that can be used for reliably matching GraphML elements to their corresponding visualizations in an SVG document). If developing a custom application for this purpose is an option for you, yFiles is the way to go.