This is a very generic question that can only be answered in a very generic manner.
Styling, aerodynamics, project management, powertrain, marketing, etc come up with an outside shape that is sufficient to fit whatever needs to be put inside, meets the aerodynamic requirements, satisfies the stylists, etc.
Then body engineering designs all the inner structure bits that are necessary to meet crash requirements, meet NVH requirements, comply with all the applicable standards in the entire universe in which the car will be sold (not easy), allow the doors to open and close properly, not trap water in places that will cause premature rust, be constructed out of sheet metal parts that can actually be built (not easy), and in many cases fit the bodyshell over an existing "platform" that defines where many of the components have to be and in many cases defines what those components are and how they attach. Then manufacturing gets involved and the design changes from what it would be nice to build, to what can actually be built.
The process is iterative. It repeats many times in finer and finer detail. It backtracks once in a while when someone discovers an "oops". And there will be "oopses". Lots of them. Some early in the process, some late in the game when something happens that no one foresaw. Some of them after production start.
I only see it when it gets to the robots and the tooling that are involved in sticking all the bits and pieces together. (usually welding, not always) An "oops" at this stage changes robots and fixtures ... and it has happened, Many times.