I've been watching Manhattan the last few days (a great show even if a little inaccurate in points) and one of the background plot points is that it's a race to develop an atomic bomb before the Nazis can do so.
While I understand that the US was the only country to devote substantial resources to the task, how is it that both countries came to be developing a previously unheard-of superbomb at the same time?
Did the concept of an atomic bomb exist beforehand and both countries already dabbled in the idea but the war just accelerated things? This seems logical but as far as I can tell no one publicly guessed that such a thing might be in the works, and if the concept existed I would think there would have been calls for it to be made into a reality (by those who didn't know it already was in the works).
Was the Nazi atomic bomb program substantially similar in its end goal? Would they have arrived at essentially the same bomb the Americans built, given the time and resources to conclude their program?
Did any other countries have a program in the works during the war?
The other responses linked go into more detail about the state of the German program versus the American one, but to address your basic question: both the American and German programs were spurred by the same initial discovery, which was nuclear fission and the possibility of a nuclear chain reaction. This was "open science" prior to the beginning of the war, and was stimulating to scientists in many nations. By 1940 or a bit after, scientists in a number of nations — Germany, the United States, France, the United Kingdom, the Soviet Union, Japan — had taken this "open science" and used it as a justification to petition their governments to devote funding to the question of whether fission had military implications.
So it is not a coincidence at all; the same discoveries (Hahn/Meitner/etc. on fission, Joliot on secondary neutrons) stimulated both of them, because to a technical eye they implied the possibility of releasing nuclear energy on an industrial or military scale.
There is a large gap between "a small committee looking into this matter" and "a weapon production program," however. The early US and German efforts were essentially similar and had basically even the same name (Uranium Committee vs. Uranverein). They were both concerned with figuring out, based on small-scale experiments and theoretical work, whether nuclear bombs were going to be a problem for the current war or whether they were going to be an issue decades down the line. Both the US and the Germans initially concluded that the odds of them being used in the current war were low — that the risks of failure were very high, and the effort to make them would be very large. The crucial difference is that in 1941 scientists from the United Kingdom convinced the US it wouldn't be as hard as all that, and further work made the US more confident that a bomb was doable. There was also a crucial difference in fear: the Americans and British feared German success much more than the Germans feared American success on this matter, for a variety of reasons (the presence of Jewish refugees among the US and UK scientists working on this is a not insignificant factor — they feared the Nazis for very acute reasons).
The result is that in the summer of 1942, the German government decided that they would limit their research program to a modest nuclear reactor pilot program, whereas the American government at the same time dedicated itself to a full-scale nuclear weapon production program. So the paths diverged very significantly. The Americans were still driven by a fear of the German program for much of their work, though by November 1944 they had conclusively determined that the Germans were not building a bomb.
By the spring of 1945, the small German program had almost succeeded in making a prototype nuclear reactor that worked. Whereas by the summer of 1945, the United States had three industrial-sized nuclear reactors producing plutonium, as well as a full capability to enrich uranium to weapons-grade levels, and had designed two different ways to use the fuels in a weapon. But that is the difference between a program with at most a few dozen researchers working on it, tallying up to the equivalent of maybe a million dollars or so of investment, and a program with 500,000 people working on it (including over 10,000 technical staff), spending two billion dollars on it.
The Germans would never had reached an atomic bomb with the program they had during World War II. It was not a bomb program. No country other than the United States had a bomb production program during World War II, though two (Japan and the USSR) had very small programs; of these, the German one was the largest wartime program.
Our resident nuclear expert /u/restricteddata (who was a consultant on Manhattan) has written about the German nuclear program a few times. Here are some links from a couple of AMAs he's done, which if you expand them out also talk about programs in the UK and some Soviet interest in atomic weapons. Apologies for the scattered/AMA nature of this, I could swear that restricteddata has answered in a standalone question but I can't find it right now.
https://www.reddit.com/r/AskHistorians/comments/3e76ig/ama_the_manhattan_project/ctc9exp/
https://www.reddit.com/r/AskHistorians/comments/3e76ig/ama_the_manhattan_project/ctca0u2/
https://www.reddit.com/r/AskHistorians/comments/3e76ig/ama_the_manhattan_project/ctcuvhn/