Rambam's Mishna Torah is a foremost halachic source. I've been very interested lately in the history of Halacha – I've just begun learning Mishna Torah for the first time – and was wondering if anyone can share insight on how Rambam actually developed ideas he presents in his Mishna Torah. What decisions did he need to make? Which ancient sources did he go to?
The ideas need to have a historical precedent otherwise they are really just born out of Rambam's own mind. So what is the link between M"T and previous Jewish works?