During the 1930s, numerous physicists around the world were doing research into radioactive substances. The first fission chain reaction took place, under lab conditions, in 1938. The theoretical explanation of what was going on (that a uranium-235 nucleaus absorbed a neutron and then disintegrated into baryum, krypton, and more neutrons, losing some mass in the process) was published in February 1939. Einstein’s E = mc² had been known since 1905, so once you have that, the idea that the lost mass had to result in a release of energy also suggests itself.
This is all pre-WW2, even if only slightly. So what exactly was it that the enormous efforts put into the Manhattan Project had to achieve? I can see that it was a major industrial challenge to produce a critical mass of fissile material, as naturally occuring uranium has a low concentration of the fissile isotopes. But was there also a need for more research into theoretical physics?
Short answer? The Project aimed to develop a political and/or military instrument of power. The Manhattan Project’s goal was to weaponize the theory into a practical solution to end the War.
It was well known that Axis Powers had discovered the nature of fission, and it’s ability to release large amounts of energy. What wasn’t well known was how far along they were in the process of developing ‘superweapons.’
Thus, our Manhattan Project was to get there first in the hopes that employment (or the mere deployment) would bring the war to a close–either by diplomatic means (Axis suing for peace before they’re bombed), or by military means (as history played out.)
. . . and then the Soviets got copies of our work, and the Cold War started.
There’s a lot of ground to cover in between discovering that you can create a nuclear chain reaction, and then controlling that reaction, and then putting it into something that can be delivered to a target and begun remotely.
Doing something in a controlled environment is very different from doing it in the field.
Also, as Tripler hints at, the Americans weren’t the only ones trying to do this. A big part of the Manhattan Project was gathering intel on what everyone else was up to.
The Manhattan Project integrated all scientific and engineering fields and was responsible for truly beginning the �Atomic Age.� Throughout the three-year endeavor, invaluable discoveries were made concerning bomb dynamics and mechanics, materials and plastics, atomic particles, nuclear fission and the beginnings of fusion, uranium, plutonium, and the efficiency of collaboration among multiple scientists and field leaders. Although the goal of the program was not morally humane, the project certainly achieved and surpassed everyone�s ambitions. Whether the bombs� employment and the execution of hundreds of thousands of Japanese lives were necessary will never be known. But the research completed in the 1940�s on atomic energy continues to show significance and promise in today�s world and will persist to play an increasingly important role in America�s history � yet another reason why the Manhattan Project is the epitome of scientific engineering success.
The Manhattan Project also produced a plutonium bomb. The Hanford Site’s (one of the three main sites of the Project, along with Los Alamos and Oak Ridge) main job was creating and refining plutonium. Plutonium was discovered before the war, but not published until after, due to security.
One of my major takeaways from that book — not explicitly stated, but certainly a conclusion you can draw — is that the scale of the operation was necessary for its secrecy. They couldn’t have people coming and going on a regular basis, relying on outside (insecure) services for food and laundry and other day-to-day essentials. These facilities had to be largely isolated and self-sustaining, in order to maintain informational segregation.
So, in effect, if you had, say, 75k people on site, only a few hundred of them would have been directly involved in the research and engineering of the site’s deliverables. The rest were there to support general livability: cooking, cleaning, education for the core team’s families, and on and on and on. They really did stand up a more-or-less functional city behind the fence.
This is not a direct answer to the OP’s question, but it does provide some context: “What were those thousands and thousands of people in the Project really working on?” Most of those thousands of people weren’t working directly on the Project, they were making it possible for the relative handful of primary people to do their work in secrecy.
The fissile mass to trigger an explosion.
The best and fastest way to assemble a critical mass to create fission without making the bomb blow itself up prematurely.
How to separate U-235 from U-238.
How to make everything reliable enough to ship across the Pacific, drop from a plane and still work.
How much yield the bomb would produce.
The Tube Alloys programme in Britain and Canada was the first nuclear weapons project. Due to the high costs, and the fact that Britain was fighting a war within bombing range of its enemies, Tube Alloys was ultimately subsumed into the Manhattan Project by the Quebec Agreement with the United States, under which the two nations agreed to share nuclear weapons technology, and to refrain from using it against each other, or against other countries without mutual consent; but the United States did not provide complete details of the results of the Manhattan Project to the United Kingdom. The Soviet Union gained valuable information through its atomic spies, who had infiltrated both the British and American projects.
I came in here to say this. It is one of the better non-fiction books I’ve read.
The science was largely understood. The MP was a massive program to put all the different disparate parts together to result in a bomb. The two main problems were largely engineering:
Refining a quantity of radioactive material potent enough to make a bomb. A lot of theoretical work was done to figure out what was potent enough.
Figuring out how to trigger the chain reaction. The theory was known–just squeeze the material until it became dense enough–but there was a lot of engineering that needed to be done. The plutonium bomb was basically a ball of plutonium surrounded by explosives. The MP had to figure out how to arrange the explosives and trigger them so it compressed the plutonium correctly.
The theoretical physics was pretty well known. In fact, the original Manhattan project was triggered by a letter to the president from some top nuclear physicists (including, IIRC, Einstein).
Theory is theory, but there were a number of unproven pieces.
Each fission of a uranium atom from a neutron hitting a nucleus produced more neutrons. Theoretically this could proceed immensely fast, and release a massive amount of energy in a short time - just like a chemical explosion. The question was - could it be done practically ?
Theory says you needed enough pure uranium, the right isotope, to make the chain reaction happen.
You needed a “critical mass” - too small, nothing really happens since the neutrons’ likelihood of collision was below critical - too much mass, it goes off the moment you bring this mass together. How much mass? How do you assemble the mass to critical size at just the right time? Can you assemble it fast enough that the reaction doesn’t start before there’s enough mass to make a full explosion? (A fizzle instead) Alternatively, there was one scientist who bet that the first test might create a reaction that would continue and consume the whole earth. (He lost his bet, paid up when the first test was over)
Can you even make something that can be transported by aircraft and dropped like a regular bomb? You can’t drop a reactor the size of a tennis court on Hiroshima. How do you refine the critical mass materials? Separating isotopes was a whole different process to anything ever done before, and you needed about 8kg or more of pure fissible uranium for this to work. plutonium, being a different element, was far easier to refine - but had to be “baked” in a reactor because it was too short half-life to be found in nature.
(One of the things Richard Feynman mentioned in his books was that even proper storage of partially refined uranium isotopes was something they were learning as they went along. As was calculating the fine details of how the explosion should work, to prove the reaction would happen as planned.)
The Manhattan Project was busy solving all these issues together to produce an actual working bomb.
Plus, the infrastructure to separate isotopes for critical mass was a massive investment - not something a bunch of scientists could do on a university physics dept budget. Let alone test site, explosives research, aircraft, etc. There’s a reason the Manhattan Project consumed such a huge amount of money.
You can make an analogy to the moon project. The physics of sending an object to the moon was well known. Even the physics of rockets and rocket fuel had been explored.
But the practical problems of designing a rocket ten times larger than anything seen before, boosting all that weight into orbit, making sure that all the parts would work in a vacuum, worrying about radiation as in the Van Allen belts, knowing what the surface of the moon would be like, and a thousand other unknowns had to be worked out bit by bit, trial and error, for a decade to get the Apollo landings successful.
Besides what others replied in excellent fashion, I would mention here that some unknowns could have been showstoppers. As in: “one item that stops or could stop the progress, operation, or functioning of something”. The levels of the dangers involved were also checked by the colossal effort, not just the “How to’s”.
One item that was mentioned among some engineers or physicists was the possibility (that was found to be very unlikely by the people involved) that an atomic explosion could cause also a fusion chain reaction in the atmosphere or the seas. Vaporizing not only the enemy but all life on earth.
The Manhattan Project scientists clearly took lighting atmospheric fire to be a serious possibility, although how they dealt with this possibility seems to be a matter of some historic contention. A 1959 interview with Pearl S. Buck with Arthur Compton, a leader of the Manhattan Project (pictured in Fig. 1 well before World War II, with fellow physicist Werner Heisenberg), tells a highly melodramatic account of these considerations. Buck starts the account with a phone call from Oppenheimer to Compton asking to meet immediately to discuss “something very disturbing—dangerously disturbing …”: 
Briefly, it was that the scientists under his [Oppenheimer’s] leadership had discovered the possibility of nuclear fusion (as distinguished from simple fission ). In other words, the principle of the hydrogen bomb.
It was the supreme danger, tremendous and unknown, much worse than atomic explosion.
“Hydrogen nuclei,” Arthur Compton explained to me, "are unstable, and they can combine into helium nuclei with a large release of energy, as they do on the sun. To set off such a reaction would require a very high temperature, but might not the enormously high temperature of the atomic bomb be just what was needed to explode hydrogen?
“And if hydrogen, what about the hydrogen in sea water? Might not the explosion of the atomic bomb set off an explosion of the ocean itself? Nor was this all that Oppenheimer feared. The nitrogen in the air is also unstable, though in less degree. Might not it, too, be set off by an atomic explosion in the atmosphere?”
“The earth would be vaporized,” I said.
“Exactly,” Compton said, and with what gravity! “It would be the ultimate catastrophe. Better to accept the slavery of the Nazis than to run the chance of drawing the final curtain on mankind!” 
Curiously enough, the Nazis themselves encountered similar worries, which perhaps prevented the government from fully supporting its own physicists in nuclear weapons research. (For a more full account of German nuclear research in World War II, see Wendorff. ) In his memoirs, Albert Speer recounts Heisenberg’s evasiveness as to the question of whether fission was guaranteed to be controlled:
Actually, Professor Heisenberg had not given any final answer to my question whether a successful nuclear fission could be kept under control with absolute certainty or might continue as a chain reaction. Hitler was plainly not delighted with the possibility that the earth under his rule might be transformed into a glowing star. Occasionally, however, he joked that the scientists in their unworldly urge to lay bare all the secrets under heaven might some day set the globe on fire. 
In drastic contrast to such images, Bob Serber, writer of Los Alamos Laboratory Report LA-1 (dubbed the Los Alamos Primer), provided a far less dramatic account at odds with Compton’s own account, and downplayed the prominence of such fears within the Manhattan Project:
Edward [Teller] brought up the notorious question of igniting the atmosphere. Bethe went off in his usual way, put in the numbers, and showed that it couldn’t happen. It was a question that had to be answered, but it never was anything, it was a question only for a few hours. Oppy made the big mistake of mentioning it on the telephone in a conversation with Arthur Compton. Compton didn’t have enough sense to shut up about it. It somehow got into a document that went to Washington. So every once in a while after that, someone happened to notice it, and then back down the ladder came the question, and the thing never was laid to rest. 
Whereas Serber seems to dismiss the discussion as short and Compton’s concerns as overblown, Buck’s interview with Compton tells a prolonged process supervised in part by Compton that eventually ruled out the scenario, but only after far more than a few hours’ consideration:
During the next three months scientists in secret conference discussed the dangers of fusion but without agreement. Again Compton took the lead in the final decision. If, after calculation, he said, it were proved that the chances were more than approximately three in one million that the earth would be vaporized by the atomic explosion, he would not proceed with the project. Calculations proved the figures slightly less - and the project continued. 
While the second testimonial makes a vaporization less of a concern, the reality is that the ones involved did check, and realized that the dangers were not as very few feared. Still I do remember reading about Enrico Fermi at Trinity taking bets about the first nuclear blast to be from a dud up to the atmosphere igniting, and whether it would destroy just the state, or incinerate the entire planet.
To decide how good it is we should consider statements such as:
"In early 1945 … Japan was retreating from its Pacific empire. " [True for values of “retreating” that include “trying about as desperately as any nation ever has not to be pushed”.]
“Although the goal of the program was not morally humane …” [The goals included bringing the war to an end while avoiding loss of life - certainly including Japanese life - on the scale that an invasion or long blockade would entail.]
It did not, it is one of those statistical things that most people are not aware of.
The cost of the B-29 programme was about 3.4 billion USD for 3,970 aircraft at an average of 640,000 USD per aircraft. That gives you a development cost of roughly 900 million USD.
Of the 2.5 billion USD the Manhattan Project cost, some 1.9 billion were development costs, the rest, 600 million USD was for the development of the ‘Test Article’, better known as ‘The Gadget’, and a production run of 200 deployable nuclear weapons (Mk-I Little Boy (5 build), Mk-IIIA/B Little Boy (45 build), and Mk-IV(150 build)).
Note that virtually all the deployable weapons were not built until after the war, so that the material costs during the war were much lower.
IOW, the Manhattan Project costs were almost all development and the B-29 costs were almost all production.
The Manhattan Project also left behind a lot of infrastructure. Some of it useless, like the S-50 uranium enrichment plant, some was dismantled like the Y-12 plant. But the K-25 enrichment plant usefully enriched uranium for decades. The plutonium infrastructure similarly served for decades. Not all with happy endings.
It is hard to compare development costs with production relative to very different projects. The production infrastructure for a plane is of a very different scale to the production infrastructure for a nuke.