Inferences based on potential or probability of occurrence cannot be used as evidence or criteria to establish evidence. In situations of gray areas, one need to use one's judgment to decide:
- Is the risk of harm worth the benefit that will be gained?
- What is the probability of harm materializing, and what is its impact?
Based on this, one can proceed based on this guideline. The ruling may differ by context. Taking your example of driving, it may be that one person is allowed to drive, but another is not. One person is allowed to drive under specific conditions, or specific vehicles, or in specific geographical areas, etc. The ruling will not be of broad nature, e.g., the case of computer causing harm to eyesight applies only to the context of this specific case.
I have added more information below for you to read at your leisure, starting with some common definitions, then the guidelines. Since your question is mainly focused on the guideline pertaining to probability and potential, I have elaborated on this guideline more than the others in the read-later content below.
Definitions of darar and dirar
There are many definitions of the words darar and dirar. I am quoting one source that, in my opinion, provides comprehensive definitions that cover most of, of not all, the applicable meanings of the words in the context of religion. Dr. Muslim ibn Muhammad ibn Majid Al-Dawsari (Arabic: مسلم بن محمد بن ماجد الدوسري) in his book Al-Mumti' Fi Al-Qawa'id Al-Fiqhiyya (Arabic: الممتع في القواعد الفقهية), First Ed. Riyadh: Dar Zidni, 2007, pp. 212-213, defined the terms as follows:
القول الأول: أن الضرر إلحاق الإنسان مفسدة بغيره بحيث ينتفع هو بذلك الإلحاق، وأما الضرار فهو إلحاق الإنسان مفسدة بغيره بحيث لا ينتفع هو بذلك الإلحاق
The first definition: darar is inflicting injury or damage to others, which results in benefit to the inflicter. Dirar is inflicting injury or damage to others, which does not result in any benefit to the inflicter.
القول الثاني: أن الضرر إلحاق الإنسان مفسدة بغيره ابتداء، وأما الضرار فهو إلحاق الإنسن مفسدة بمن أضرَّ به على سبيل المجازاة على وجه غير جائز
The second definition: darar is to initiate inflicting injury or damage to others [action], whereas dirar is inflicting injury or damage to others in an unlawful retaliation [reaction].
القول الثالث: أن الضرر اسم والضرار مصدر، فالمصدر الذي هو الضرار يشير إلى فعل الضرر والوقوع فيه، والاسم الذي هو الضرر يشير إلى ما يوصل إلى فعل الضرر الوقوع فيه ويكون وسيلة إليه
The third definition: darar is a noun, and dirar is a source. The source, which is dirar means committing the darar, while darar means the means that leads to the act and the resulting damage or injury.
NOTE: My own translation, so treat with care.
This means that the prohibition in the hadith covers:
- committing harm (direct),
- committing harm's means (indirect)
- with the recipient of the harm being oneself or others.
Bases on these definitions, harm is being used as the direct meaning of the word, or as an antonym of benefit. That is, as committing harm is prohibited, then conversely introducing benefit or removing harm is endorsed (as in Sahih Muslim 1/60 where removal of harmful objects from the roads is considered a branch of faith). Muhammad Yahya Al-Walati (Arabic: محمد يحيى الولاتي) in Issal Al-Salik Fi Usul Al-Imam Malik (Arabic: إيصال السالك فى أصول الإمام مالك), First Ed. Tunis: Al-Matba'a Al-Tunisiyya Nahj Souq Al-Balat, 1346 AH, pp. 34, said:
وجوب إزالة الضرر عمن نزل به والأصل في هذه القاعدة ما رواه مالك في الموطأ أن رسول الله ﷺ قال «لا ضرر ولا ضرار» لأن الشريعة مبنية على جلب المصالح ودفع المفاسد وتندرج تحت هذه القاعدة قاعدة ارتكاب أخف الضررين
... which is the mandate of removing the harm from those who are affected. The origin of this rule is what was narrated by Malik in Al-Mawatta' that the Messenger of Allah ﷺ said: "No darar and no dirar." This is because the Shari'a is based on seeking benefits and warding off harm.
NOTE: My own translation, so treat with care.
Extending this concept, the expiation of causing harm is to fix or replace the outcome, being damage or injury (as in Sunan Al-Nasa'i 36/19 ruling: "A dish like that dish, and food like that food.").
The following guidelines were established by multiple scholars (too many to cite):
- Harm cannot be warded off by an act causing equal or more harm. For example, the hadith Sahih Al-Bukhari 34/109 indicates that smuggling goods across borders is forbidden, even when it pertains to smuggling needed medicine (see fatwa 64340). Example: If one is at risk of dying out of thirst, one is not allowed to ward off one's harm by depriving another person of water if the other person is also at risk of dying out of thirst.
- Harm must warded off as much as possible. Example: No mother should be harmed through her child because of breastfeeding (see Qur'an 2:233).
- Warding off the higher of two harms takes precedence. Example: Amputating a limb (harm) to avoid risk of infection and gangrene (higher harm).
- Warding off harm has higher priority than bringing forth benefit. This is a widely-used guideline in jurisprudence. Example: Drinking alcohol and gambling have their benefits, but their sin is so high that it erodes their benefit (see Qur'an 2:219).
- Warding off evil does not include abandoning lawful punishments. Punishments in Shari'a are meant as a deterrent for the benefit of a broader base: the society. Hence, a punishment, while it may seem cruel, it makes the world safer (see Qur'an 2:179).
- When both harm and benefit coexist, if harm is equal to or greater than the benefit, warding off harm takes priority. If benefit outweighs harm, bringing benefit takes priority (see Izz al-Din ibn Abd al-Salam in his book Qawa'id al-Ahkam fi Masalih al-Anam said in the chapter titled "When benefit and harm co-exist" — Arabic only).
- Inference based on potential is not evidence.
This last guideline (inference based on potential is not evidence) is the one that applies to your question. This is a well-known principle in jurisprudence: What is inferred based on potential (or probability) is not classified as evidence (Arabic: إذا وجد الاحتمال بطل الاستدلال). This is not to be taken at large; it is a highly contextual guideline that only scholars with wide knowledge of the fundamentals of jurisprudence can apply properly. This guideline is based on:
إِنَّ الَّذِينَ لَا يُؤْمِنُونَ بِالْآخِرَةِ لَيُسَمُّونَ الْمَلَائِكَةَ تَسْمِيَةَ الْأُنثَىٰ وَمَا لَهُم بِهِ مِنْ عِلْمٍ ۖ إِن يَتَّبِعُونَ إِلَّا الظَّنَّ ۖ وَإِنَّ الظَّنَّ لَا يُغْنِي مِنَ الْحَقِّ شَيْئًا
Indeed, those who do not believe in the Hereafter name the angels female names, and they have thereof no knowledge. They follow not except assumption, and indeed, assumption avails not against the truth at all.
— Qur'an 53:27-28
Scholars have classified verses of the Qur'an and hadiths as, in terms of being evidence, either peremptory (Arabic: نصوص قطعية الدلالة) or irresolute (Arabic: نصوص ظنية الدلالة). Peremptory or authoritative verses are clear cut, obvious, specific, conceptual or specifically-contextual with clear conditions, etc. For example, on the matter of inheritance, there is only one way to interpret "And for you is half of what your wives leave if they have no child.":
وَلَكُمْ نِصْفُ مَا تَرَكَ أَزْوَاجُكُمْ إِن لَّمْ يَكُن لَّهُنَّ وَلَدٌ ۚ فَإِن كَانَ لَهُنَّ وَلَدٌ فَلَكُمُ الرُّبُعُ مِمَّا تَرَكْنَ ۚ مِن بَعْدِ وَصِيَّةٍ يُوصِينَ بِهَا أَوْ دَيْنٍ ۚ وَلَهُنَّ الرُّبُعُ مِمَّا تَرَكْتُمْ إِن لَّمْ يَكُن لَّكُمْ وَلَدٌ ۚ فَإِن كَانَ لَكُمْ وَلَدٌ فَلَهُنَّ الثُّمُنُ مِمَّا تَرَكْتُم ۚ مِّن بَعْدِ وَصِيَّةٍ تُوصُونَ بِهَا أَوْ دَيْنٍ ۗ وَإِن كَانَ رَجُلٌ يُورَثُ كَلَالَةً أَوِ امْرَأَةٌ وَلَهُ أَخٌ أَوْ أُخْتٌ فَلِكُلِّ وَاحِدٍ مِّنْهُمَا السُّدُسُ ۚ فَإِن كَانُوا أَكْثَرَ مِن ذَٰلِكَ فَهُمْ شُرَكَاءُ فِي الثُّلُثِ ۚ مِن بَعْدِ وَصِيَّةٍ يُوصَىٰ بِهَا أَوْ دَيْنٍ غَيْرَ مُضَارٍّ ۚ وَصِيَّةً مِّنَ اللَّهِ ۗ وَاللَّهُ عَلِيمٌ حَلِيمٌ
And for you is half of what your wives leave if they have no child. But if they have a child, for you is one fourth of what they leave, after any bequest they [may have] made or debt. And for the wives is one fourth if you leave no child. But if you leave a child, then for them is an eighth of what you leave, after any bequest you [may have] made or debt. And if a man or woman leaves neither ascendants nor descendants but has a brother or a sister, then for each one of them is a sixth. But if they are more than two, they share a third, after any bequest which was made or debt, as long as there is no detriment [caused]. [This is] an ordinance from Allah, and Allah is Knowing and Forbearing.
— Qur'an 4:12
Irresolute verses, on the other hand, are open to interpretation, and could bear more than one meaning, or become prone to a criterion that may be soft or lacks clear distinction. For example, in discussing the 'iddah of a divorced woman:
وَالْمُطَلَّقَاتُ يَتَرَبَّصْنَ بِأَنفُسِهِنَّ ثَلَاثَةَ قُرُوءٍ ۚ وَلَا يَحِلُّ لَهُنَّ أَن يَكْتُمْنَ مَا خَلَقَ اللَّهُ فِي أَرْحَامِهِنَّ إِن كُنَّ يُؤْمِنَّ بِاللَّهِ وَالْيَوْمِ الْآخِرِ ۚ وَبُعُولَتُهُنَّ أَحَقُّ بِرَدِّهِنَّ فِي ذَٰلِكَ إِنْ أَرَادُوا إِصْلَاحًا ۚ وَلَهُنَّ مِثْلُ الَّذِي عَلَيْهِنَّ بِالْمَعْرُوفِ ۚ وَلِلرِّجَالِ عَلَيْهِنَّ دَرَجَةٌ ۗ وَاللَّهُ عَزِيزٌ حَكِيمٌ - 2:228
Divorced women remain in waiting for three periods, and it is not lawful for them to conceal what Allah has created in their wombs if they believe in Allah and the Last Day. And their husbands have more right to take them back in this [period] if they want reconciliation. And due to the wives is similar to what is expected of them, according to what is reasonable. But the men have a degree over them [in responsibility and authority]. And Allah is Exalted in Might and Wise.
— Qur'an 2:228
The word quru' (Arabic: قروء) interpreted here as periods could mean in the Arabic langugae as the period during menses or the period in between two states of menses.
Then another set of classifications apply:
- Generality (Arabic: معمم) vs. specificity (Arabic: مخصص)
- Absolute (Arabic: مطلق) vs. contextual (Arabic: مقيد)
- Broad (Arabic: مجمل) vs. explicit (Arabic: مبين)
If nothing else, at least now it is clear why there are difference of opinions among scholars (not to mention level of understanding of the Arabic language among them).
Based on the above, when harm and benefit are conditional — as in your example of riding a car — then:
If the act is related to a declared 'ibabdah, the probability of harm is ignored. For example: If I go to hajj, I may die due to a building collapse. I still need to perform hajj if I am capable of doing so financially and physically, and I have not performed it up to that time.
If the act is not related to a declared 'ibabdah (e.g., use of vehicles, electricity, gas, etc.), then if the risk is very high (either the frequency of occurrence being high, or the impact being severe) that a harm occurs, one has to avoid said act. This is left to the person to decide at the time.
If a condition is present temporarily that causes the act to be more risky (e.g., weather conditions that may render driving at a specific time of higher risk than other times), one has to wait for the condition to change; or revert to the other rules if time is of essence. This was demonstrated in several incidents during the time of the Prophet ﷺ where he ordered Ibn Maktoum to pray in the masjid (going to the masjid for prayers is not of a higher risk than going to other places), but stopped all Muslims from praying in the masjid during the time of heavy rain.
As you can see, these conditions really employ common sense that one would typically tend to do in any case.
References not found online
Al-Mumti' Fi Al-Qawa'id Al-Fiqhiyya (pp. 212-3)
Issal Al-Salik Fi Usul Al-Imam Malik (pp. 34)