An engineering degree gets you part of the way. You spend four+ years learning the basics of machine design, fluid mechanics, thermodynamics, heat transfer, metallurgy, and so on. Or you go for a couple more years to get a master’s degree in a more specialized area. Or you go for several more years to get a Ph.D. in a very specialized area.
“Institutional knowledge” is another part of the puzzle, and comes with experience. Some of that is in the heads of the engineers. A senior engineer from Ford will know from experience roughly how far apart to place the attachment points for a door panel, dashboard, or headliner so as to minimize buzz, squeak and rattle, something that submarine designers won’t know. He’ll know from his engineering classes that a submarine propeller blade will utilize a “wing” cross section to produce thrust, but he won’t know exactly what shape is most efficient, least noisy, or least prone to cavitation under various conditions - something that experienced submarine designers will know.
Some of that institutional knowledge is proprietary, i.e. not all submarine designers will know it. If your company has invented an alloy that’s particularly resistant to seawater corrosion, or developed a propeller that’s ultra-quiet, or a novel welding process that makes explosion-resistant hull joints, you’re not going to share that with your competitors.
Some of it is incremental development: you take one of your submarine designs that worked pretty good in the past, and you improve on it.
Some of it is independent design and testing. The components of a submarine are not 100% independent, so you can parcel out the work to separate design teams and bring it all together at the end. You can find examples of this in other industries. Here, for example, is a lab test of the Airbus A380’s landing gear: the wheels are are spun up to touchdown speed, and the whole landing gear is slammed to the ground at “hard landing” vertical speed, with all of the momentum on it that a real A380 would have during a hard landing. Likewise, here’s a laboratory brake test, in which they simulate braking the A380 to a stop in an overweight condition with no reverse thrust. How does the brake behave? Does it disintegrate? Does it catch fire? If so, does the fire spread? There will be a full-up aircraft test like this later on, but you don’t want that to be the first time you’ve tried using the brakes; it’s possible to gain confidence first with test cell work like this. There’s a lot of the same sort of thing you can do for a submarine.
And no matter what you make, there’s a lot of testing/redesign iteration along the way. Decades ago you’d make scale models or full-sized prototypes based on your engineering degree and institutional knowledge, test them, and then refine your design based on the test results. This cycle is much faster and cheaper these days thanks to computers. You can design a part or assembly on a computer, and then use finite element analysis to assess various performance aspects. Is it strong enough? Are there stress concentrations that need to be alleviated with a little more/less material in certain spots? Are the heat transfer properties adequate/optimized? More/thinner/thicker cooling fins needed? Problematic vibrations that might be fixed with more/less mass here and there? Is it managing air/water flow/pressure as needed? You can do all of this in the computer and come up with a design that’s very likely to be very good the first time you make it.
Computers are also great for coordinating the work of all the subgroups. A central archive can hold the master plan for the submarine that hosts all of the subsystems being designed by the semi-independent groups, so that everyone can see how the different subsystems are going to mesh in the final assembly and work in a cooperative manner.
And in the end, you make your full-scale, fully-assembled prototype, and you test it as incrementally as you can. At this point it’s unlikely that you’d have to scrap the entire design, but the computer analysis is never perfect; you’ll always find little things that need adjustment. For airplanes, you start with a high-speed taxi test, in which the plane doesn’t even leave the ground. Then you take off for a very basic flight, never even raising the landing gear. You build confidence in the plane as you put it through harsher and harsher tests (e.g. a high-speed flutter test. Similar testing happens with submarines and other large machines.