Well, it's a long story. The bare-bones are thus:
After the discovery of fission was announced in early 1939, numerous scientists around the world began to search for "secondary neutrons" that would indicate whether a chain reaction could take place. The French scientist Joliot-Curie published his observation that they did exist, against the wishes of several others who would prefer the work stay secret.
Over the course of 1939 and 1940, scientists in a number of different countries (Germany, USA, UK, Japan, France, and USSR) petitioned their governments to have national fission programs. In most cases they got a small official allocation to look into the question of whether nuclear technology was likely to play a role in World War II.
In the United States, this effort is the result of the famous Einstein-Szilard letter, which was written in late 1939 to President Roosevelt. Roosevelt created an institutional basis for fission research in the National Bureau of Standards. This was not the Manhattan Project: it was an attempt to coordinate research into the question of whether nuclear technology was worth worrying about, not a program to build a bomb. This was known as the Uranium Committee.
Between 1939 and 1941, the Uranium Committee essentially concluded that there was little chance of nuclear weapons being an issue worth worrying about during World War II. The possibility of success seemed low and the difficulties and risks high.
There it might have stayed, except that a similar committee in the United Kingdom concluded that in fact it was much easier than people had realized. Not so easy that the UK thought they could do it, but easy enough that the Germans or Americans might pull it off. They sent this report to the USA, hoping it would gain interest.
Around the same time, the new element plutonium was discovered, and understood to be viable as bomb fuel as well. (Plutonium is made in nuclear reactors.)
After not hearing back from the Americans the UK sent an emissary to the USA to see why they had not responded to their report. He found that the head of the Uranium Committee had filed it away without showing it to anyone. He gave its conclusions to several high-powered physicists and administrators, convinced them of its worth, and they organized an administrative "coup" to take over the fission research.
The new, reconstituted group — now known as the S-1 Committee — began a rapid program of building pilot-scale enrichment and reactor technology, and then by the summer of 1942 had begun to accelerate towards a program of actually trying to build nuclear weapons in time for use during the war. In this effort they enlisted the Army Corps of Engineers. The initial organization under the Army was out of Manhattan, so the administrative name was Manhattan Engineer District. As it expanded into a full program, it became known as the Manhattan Project.
The irony here, in my mind, is that at the same moment the Americans were deciding that a bomb was feasible, the Germans were concluding it was probably too difficult. The initial reason to develop the bomb — to beat the Germans in a "race" — was still on the Americans' minds through 1944, but the effort easily slid into something else (the development of a first-strike weapon to use against Japan).
The UK and American early estimates were optimistic by a significant factor — it ended up requiring far more labor, and costing far more money, than they realized when they started it. However by the time it became clear that it was actually quite difficult, they had already sunk so much into the program that they were determined to see it through to completion. If they knew how difficult it actually was, or how unlikely it was to be "successful" (in the sense of having a deliverable weapon to use during the war), it is not clear they would have done it. If they had been delayed by only a couple of months, it is likely the war would have ended without the use of nuclear weapons.
The best blow-by-blow account of all of this is still Richard Rhodes' The Making of the Atomic Bomb.