While this question is similar to this question, I'm certain the answer will be very different, and far more complex....
How was the Old Testament compiled?
The following is taken from a section of the Introduction in the "Complete Jewish Bible", English Version by David Stern, entitled The Canon
There are several more pages of history regarding the formation of newer versions, New King James, etc. and the attribution of writings (who wrote which book) for the books of the Tanakh (Old Testament) in the Introduction I've sighted above. However, the passage above seems to best answer the question about the actual "compiling" of the Old Testament.
Authors like Joachim Jeremias and Gerard von Rad had shown that the origins of the OT began circa 1200-900 B.C. in the David King's dynasty, probably with the Wise Solomon. They and others are in agreement that the "David King's dynasty" text in I Kg was the first in the creation of the OT.
Since there is only one answer at the moment, I will add mine, which is from my comments.
Basically, for Christians the OT canon was still in flux until 1647 when a final decision was made as to which books would be in the Episcopalian Bible, so the OT wasn't compiled until then.
Even the Jews didn't have a unified canon until after the death of Christ.
As long as books are being added/removed/rearranged, it is in the process of being compiled.
For links to explain these dates you can look at When was the Protestant OT canon finalized?.
So, it was compiled by people coming together to determine which books should be where, and in some cases decisions to rename or split a book was made. Each group had their own reasons for their decisions, and these could be debated, but basically, long ago these decisions were argued and made, and then other groups would re-debate and make some modifications, based perhaps on newer information or better understanding.