With the expansion of Islam beyond the limits of Arabia, new cases propped up which were not directly provided in the Quran, Sunnah or Ijma, judges had to decide the matters by the use of personal opinion in the form of Qiyas maintaining the spirit of the sacred principles. In the pursuit, they were not entirely unrestrained. This became the fourth most important Source of Islamic Law, Shariah.
Whenever points of law arose in the Ummah (Islamic nation or community), which were not covered by a detailed statement in the Quran, Sunnah or Ijma, the majority of the theologians and jurists had recourse to analogical deduction, which means Qiyas in Arabic. In other words, Qiyas means the application to a new problem of the principled underlying an existing decision or some other point, which could be regarded with the new problem.
Thus the Ulama or doctors of religion arrived at answer by deduction from decisions in similar or parallel cases. To some poor and needy people the money equivalent to it may be more acceptable; therefore, the value of the goat may be given instead of the goat itself. This is the result of the problem of the Zakat giving of the poor.
The term analogy is used for a process in which you can craft an inference from the things that happened earlier and it is expected in this case also. You can also describe it in another way and can say that it is the depiction of comparison when you are intending to show a similarity in respect to something.
The use of the process can be found in several exams when the authorities intend to check the brain power of the examinees and in the process they gauge the decision making ability of the person. Their motive behind framing this kind of questions is that they think if the person can perform at this level, he can be trained to do better things in the future and thus they will be able to get a good man on their rolls.