Unfortunately we don't get a real hint until 2 movies later when the Enterprise self destructs. Then we see her frames. From that and an episode of TNG, we know that starships are built with an internal frame that most closely matches older wooden sailing ships (though most of the era the frames were wood, but toward the end several Clippers were built with metal frames and a wooden hull, such as the Adelaide).
My first assumption when trying to draft the original and the refit was that the frame and decks were altered very little. Most of the refit is a surface change rather than a deep operational one. So the core space frame remains the same and the ends of the frames are altered to the new hull lines. This leaves the majority of the ship intact and unchained (at least from a structural perspective) while the interiors were refreshed and the impulse engines, warp drive, sensors and deflectors were all replaced.
When you consider the design of Starfleet vessels, the warp nacelles seem to be designed to be interchangeable and replaceable as needed. So the real work as swapping out the TOS warp core for the TMP warp core. And if you follow Matt Jefferies and Doug Dexler's ideas that Main engineering is on the same deck as the hanger, you suddenly have a design plan that makes sense. Cut into the forward part of the secondary hull and insert the new warp core while at the same time you tear out the old warp core and convert it to a cargo handling area. That greatly saves time in the refit process.
Ships around the world have gone through many refits. Some good some bad. USS Constitution has gone through many, with some changing her lines. Most significantly in 1858, 1890, 1907, 1927, and 2016. In her years of active service, her weapons and rigging were changed at the whim of the captain. Her decorations were changed as damage and rot necessitated and at the whim of the builders. He last major cosmetic change was 1876 when she was given her current decoration and her color scheme is from 1812 and 1907.
In the 1990's any older ship that was going to remain in service went through a service life extension program. Perhaps the most significant change to the ships for that was that every watertight door was replaced with one that went to the floor (or at least much closer). So no more having to step over the high threshold of the old oval doors. That is a pretty major alteration to a welded metal ship. And going back further, between WWI and WWII, many ships received a major upgrade to their superstructure. And then the WWII carriers that stayed in service for aircraft received an angled flight neck and had the bow filled in (the WWII design had an open area at the bow where they had a couple of weapons on the deck below the flight deck).
And lets not forget the cruise ships that have been cut in two and an lengthening insert added amidship. And the aforementioned ironclad conversions.
These cover a variety of different modifications ships have gone through. When you consider the core framework revealed in Star Trek III and TNG and assume that they changed as little as possible to get the new look, you can find many parallels in the annals of Naval history. So the refit is perfectly plausible. If you assume that most of the construction time is building the frame and that very little of that was touched on the Enterprise refit, then the 18 months quoted for the refit out of a 5 year build time could make a lot of sense.
As to how much of the ship was kept... well, a ship is more than its parts. USS Constitution only retains her frames that lie under the waterline. the rest has all been replaced at one point or another (the most major in 1928). But she is considered the same ship. Her keel is intact. For many years it was believed that the USS Constellation was her sister ship, but modern examinations have proven that when her sister went into dock in 1854, that she was broken up and a new ship built. The modern ship has the lines of an 1850's corvette, not a 1790's frigate. It was one way to get a new ship without authorization. Constitution on the other hand has the same lines she did originally (the original plans exist) except for how the gunwales are finished.
So as far as I'm concerned, the TMP refit is the same ship and the refit makes perfect sense in universe.