Firstly, it arises in the context of decision making, where the probability of error may be considered as being the probability of making a wrong decision and which would have a different value for each type of error.
In hypothesis testing in statistics, two types of error are distinguished.
The fitting of many models in statistics and econometrics usually seeks to minimise the difference between observed and predicted or theoretical values.
The error is taken to be a random variable and as such has a probability distribution.
Thus distribution can be used to calculate the probabilities of errors with values within any given range.