The Allied occupation forces (the Supreme Commander Allied Powers, "SCAP") tried to make the process of creating the constitution look, as much as possible, like a voluntary process entered into by the Japanese people. On the other hand, the conventional wisdom over many years has been that the document was unilaterally drafted by SCAP, and imposed by force on the Japanese.
It appears that the answer, as is so often the case, is somewhere in the middle. Some background:
Japan's first constitution went into effect in 1890, and is known as the "Meiji Constitution". The "Meiji Era" was the official name of the reign of the Emperor Mutsuhito, from 1868 to 1912. "Meiji" translates as "Enlightened Rule".
Every emperor has such a designation. For example, the reign of Hirohito, from 1926 to 1989, was ironically called the "Showa" era, the era of Enlightened Peace. Since his death, he has been known to the Japanese as "Emperor Showa".
The 1890 constitution makes the emperor head of state, with provisions such as:
The Emperor is sacred and inviolable.
The Emperor is the head of the Empire, combining in Himself the rights of sovereignty, and exercises them, according to the provisions of the present Constitution.
The Diet was a bicameral parliament, with an elected House of Representatives, which was, in effect, little more than an advisory body. The upper house, the House of Peers, consisted of members of the nobility; it was similar to the original composition of the British House of Lords.
MacArthur and his occupation force considered that constitution to be responsible for the rise of the military class that led the Japanese to aggression against their Asian neighbors and, eventually, against the United States. In 1945, he told the Japanese government to come up with a replacement, in line with the Potsdam Declaration's democracy clause.
When the Japanese drafted relatively minor amendments to the Meiji Constitution, American lawyers responded with their own draft of an entirely new constitution. But Lynn Parisi of University of Colorado argues that the American draft was not as unilateral as it seems at first glance; it incorporated several suggestions that emerged from elements in Japanese civil society outside of government.
Also, Japanese leaders successfully resisted the unicameral parliament that was called for in the original American draft. Both houses of the new bicameral Diet would be elected. In a major change, the bulk of the power was given to the lower house, still called the House of Representatives. The upper House of Councillors would have a limited scope of powers, similar to those of upper houses in other parliamentary democracies.
What about that sacred and inviolable emperor, with his rights of sovereignty? He morphed into:
The Emperor shall be the symbol of the State and of the unity of the people, deriving his position from the will of the people with whom resides sovereign power.
There has been much commentary to the effect that, in the runup to World War II, the emperor was not the innocent victim of the military establishment, that he has been portrayed as. This revisionist point of view paints Hirohito as an active supporter of his country's aggression against Asian countries and the United States.
The World War II allies found it expedient to keep the emperor in place, during and after their postwar occupation of Japan. And, by extension, they found it expedient to downplay any role on Hirohito's part in leading his country to war.
Whatever the truth about that, it's clear that, after 1945, Hirohito, and his son and successor Akihito, have played the role of constitutional monarchs, with even less impact on their country's politics than, for example, Queen Elizabeth II of the United Kingdom.