Answering as if we conside a "real Enterprise" in a future we can call an "Enterprise future": consider a technology with the ability to create matter using a menu: this is a given in the Enterprise future, a "replicator" is used to make edible copies of food and "simple" machines. It is reasonable to imagine this technology specifically set to make designer "alloys". Alloys using current technology melting metals together, or even mixing them as gasses and then cool them. We do this to change the molectular structure to one that has physical properties we prefer. Using replicator technology we take energy and assmble the atoms, or subatomic bits and pieces of atoms, or the quarks, charms, and whatever else are found at the lowest levels we keep finding: into a material with the best desired contrast between being flexible and durable. Relating to what the ship is made of: the ship had a "structural integrity field" that gives the ship hull material more stability. We can imagine nano-circrity within molecules in small sections of the hull communicating with each other and with the ships' computer to identify stress points that need reinforcing, or sections suffering any sort of degradation.
Starships are made of many fictional materials, including but not limited to: Duranium Composite, Tritanium, Pergium, Rodinium, cortenide, transparent aluminum, polyduranide alloy, duritanium, verterium cortenide, gallicite and polyferranide.