The Quran tells those who do not know to ask the people of knowledge, and it forbids saying about Allah what one does not know. A mufti, the scholar who gives a fatwa, is expected to know the Quran and the Sunnah, the Arabic language, the method of deriving rulings, the earlier opinions of scholars and the facts of the question put to him. Because circumstances differ, a fatwa given to one person may not suit another, and for new matters, such as medicine and finance, scholars today often decide together in fiqh councils.
The Prophet ﷺ said that Allah does not take knowledge away by snatching it from people, but by taking away the scholars, until, when no scholar is left, people take ignorant men as leaders; they are asked, and they give rulings without knowledge, so they go astray and lead others astray. That is a serious warning against unqualified voices, including those on social media who issue rulings on everything.
This also answers a common worry. A fatwa is not an order to harm anyone. Penalties are for courts to carry out, after a fair trial, and not for individuals to carry out on the strength of an opinion. Statements calling for violence that have made headlines were rejected by many Muslim scholars and institutions as unqualified and contrary to the rules of Islamic law. A Muslim who has a real question can ask a scholar he trusts, ask for the evidence, and remember that sincere scholars of the different schools may differ.