If it’s not happening all the time, it can simply be bad luck
We’ll check the params.
What LL did it happen in?
No. There is a certain chance per certain time unit. It can be adjusted, but it should be based on a statistically meaningful average - as mentioned already, you can be very unlucky or very lucky (and be able to mine 10-20 minutes undisturbed).
No. Though (slightly) adjusting attack chance based on player’s “combat strength” or ship condition does sound logical (see @pikolinianita 's post). We’ll discuss what is actually technically doable.
A 100% “protection mode” can lead to unwanted consequences. Say, you get to a mining field with rare ores, let a enemy attack you and kill him fast (maybe your friends help you). Then you leave combat and re-enter mining field. Should you now be allowed to mine some rare ores for 5-10 min without any risk?
Again, a lone miner at a location with multiple aggressive enemies. What could possible go wrong? Or, rather, why exactly should they leave you alone?