Select same for group to merge to component
In certain apps such as VS Code, you can select a specific string, then press Ctrl+D, I think, and each time you press that shortcut the selection 'expands' to include one more of the potentially multiple instances of that specific string into a highlighted, select-state. You can keep pressing until all instances are selected, it tends to expand starting with the nearest, working outwards from that point in the document, to eventually include all insances.
Typically, then people would use the multi-cursor feature to replace the multiple selections of the same string with another string, or paste one from the clipboard.
In XD, if I've copied and pasted an icon and text as a group into all my artboards, then want to turn them into components at a certain point down the line to give me global control, I could select all instances of that copied group, and replace them all with another group, or component.
during the design process, while designing components and refactoring them, I often don't use symbols/components at the start because the flexibility without is beneficial, but the conversion to reusable components/symbols requires a lot of effort to abstract from these files, because of the inability to easily select all instances of quickly copied and pasted groups.