Islam / Sharia /
Fiqh was the way of creating a law system in accordance with the principles of Islam as based on the central religious scripture, the Koran, and the stories told about the Muhammad and the first Muslims. The need for systemized and verified information of the latter, motivated the development of the hadiths. The developments of the hadiths and of fiqh, thereby Sharia, were largely parallel.
Fiqh as a term is both closely related and in contrast to ¢ilm, which involves exact knowledge of the legal concepts as defined in the central religious scriptures. Fiqh is rather an interpretative technique, dealing with those issues where no exact regulation already exists. While ¢ilm is copying the regulations, fiqh involves the use of intelligence and judgement.
Much of the actual definition of fiqh, the usul al-fiqh, is from Abu Abdullah ash-Shafi'i, the founder of the Shafi'i legal school. He laid out the technique in his work "Risala."
Shafi'i defined two techniques to develop laws: Analogical reasoning, qiyas, and consensus on new judgements, ijma.
Over the first half century after the death of Muhammad (632) there had been a rivalry between the historical and the rationalist schools. The latter employed the technique of ra'y, but this would come to lose to the method of Shafi'i.
The above-mentioned ra'y and ijtihad were early on popular methods, but would never be admitted into the usul al-fiqh.
By the force of mainly ijma, but actually also qiyas, many elements from external law systems were worked into the Sharia, like Roman law and possibly also Persian law.
A person trained in fiqh, is called a faqīh.
Fiqh and Sharia appears to be mixed in many writings, and although closely linked, they represent two distinct disciplines.