I've been trying to learn/understand UV mapping, not just the process, but the concept and the technology of it. It all started with Quixel; how does Quixel know where the bits in this go with which part of the model... I don't mean which part goes with which 2D shape on the texture(which the Colour ID/Material ID/Coordinate map handles) but how the flat thing (texture) relates to the shape.(or the other way around it seems)
The more I looked into it the more I understood that I don't understand


In reading about UV mapping I've understood a bit (correct me if I'm wrong). The concept that unmapped (planar) you get a 'pixel extrusion' of the texture map in the direction of the normal of the (mapping) plane straight through the object makes sense.. first bit done.
By extension, primitive mapping makes sense too when you think about it as if its the texture being manipulated (esp because there are a lot of graphical examples of this in practice).
I've made two examples to help with my explanation of the most basic example (cube) which I would like someone to verify that I get it...
XYZ: and the corresponding UV: So using my UV and XYZ example above. After you go about 'UV'ing the model of the cube; the model will (from that point onwards) store information like UV1,0 = XYZ0,0,0 and UV1,3 = XYZ0,0,1 thereby connecting the points on the flat UV to a specific space within the world/object 3D space...
whereas before it assumed that UV0,0-3.4 = XYZ0,0,0 - 3,4,0 (planar)
In addition to the point-to-point correlation data stored in the model there is directional data (for which way the polygon faces? ie normals) and an origin and direction data for the unwrap (perhaps a whole coordinate system for the unwrap independent of the XYZ - unwrap space?) also stored in the model???
A cube is a very basic example; on something much more curvilinear, where the seams are more complex; how are the points along a 3d curved edge(seam) assigned to the UV?
and this is the part where there is a gap (for me) is after a more complex mesh is unwrapped how does that mesh understand where to stick itself to the texture? (or vice-versa)
There are some pretty confounding examples around; like in the Quixel tutorials where its like someone has one of those paper models which starts as a flat sheet and you cut out the pieces and glue tabs along each edge to make the joins... Like this: There is a Rhino tutorial which shows the mesh unwrapped so it can be used and manipulated as a reference overlayed onto the texture. This method (of connecting the xyz points to UV seems to make the most sense for connecting xyz->uv for curvy shapes, since you get as much coordinate detail as is available in the mesh. HOWEVER, it takes us back to the issue of how the whole thing is unwrapped without distorting the poly/tris... ie how do you 'tear' a concave surrounded by convex (donut) without distortion or overlap?
EDIT: is scale of the XYZ and UV independent of the mapping? in other examples the unwrapped mesh was scaled and moved around over the texture and presumably the texture could change size at some point... ??? more confusion

EDIT2: I assume scale is independent because Quixel can scale the maps on the fly; meaning it can either interact with the model (to update the coords) or the UV mapping system is relative...
I suppose its not all that important how it does it, or even how much room on the UV it takes up (VRAM aside); so long as you (I) understand that it needs to be done - so that your model contains the complex information of which xyz goes with which relative uv - otherwise you get planar by default.
It does however raise the question, are there better and worser methods (algorithms/techniques/technologies) for dealing with complex unwraps of curvilinear surfaces which do not have intentional UV seams which support tidy unwraps?
And.. by extension of that question; are there unwrapping softwares that handle the process automatically based on the 'what' is being unwrapped? (think material substance aware, rather than just surface finish). Consider the different but to my mind consistent UV unwrap needs (based on manufacturing technique) of a single material carved object, vs an engineered object, vs a formed object, vs a machined object (segmented/notched but still whole).
Lastly, while I started this looking for better understanding of UV's for texture painting, it seems like its least applicable to painting, since painting is a (mostly) material substance indifferent process... while I am curious about how it works, and confirming that its all stored in the mesh/model and will not just disappear/be purged on me perhaps it doesn't matter assuming all unwraps are equal?
Truly mind-bending stuff

Any comments/corrections/speculation or even suggestions for the next bit of reading/video greatly appreciated - thanks in advance.