The probability of making a type 1 error

What determines the probability that we commit a type 1 error? This will be illustrated by a simple simulation example.