Before the declared start of WWII in 1939 there had been many concentration camps. As soon as the National Socialists were voted into power they started using such, with Dachau as the first bigger one, and used the same name as the British had used for their concentration camps in Africa. The Nazis interned dissidents and soon also Jews, Gypsies, homosexuals etc.
Stalin had used concentration camps for suspected dissidents for years, and Germans were taught by the Russians about how to do it effectively.
With the war came the need to concentrate prisoners of war as well as "dangerous" civilians in the conquered territories, which the Japanese had been doing since their wars began in the early 30s.
The Germans had most POW camps far from the front, in eastern Germany or Poland, and so did the British e.g., sending Axis POWs to Canada.
In the German dominion there were several types of camps: transit camps, labour camps, or sole detention. From the Wannsee conference 1942 surged the idea of "the final solution" in extermination camps. These were mainly in modern-day Poland, and some (e.g. Treblinka II) were constructed even without barracks but only a death chamber and a cremation place.
German records show the existence of 1200 camps in their area, but other sources mention 15000.
The amount of Soviet and Japanese camps is hard to analyse. The Japanese rejected (like Mussolini) the anti-Semite policies. In Britain there were hundreds of camps too. The USA held hundreds of camps all over the country. The western allied camps had better survival rates than the Russian or Axis, but even there arose complaints of bad treatment of the POWs.
After the war, many of the Nazi camps were used to detain Nazis instead.