I am currently learning about hypothesis testing and I really don't understand why do we take into consideration the probability of the events to the left and to the right of the observed value (or just to the left, or just to the right in the cases when we are interested if a parameter is only greater or smaller than the hypothesized value of the parameter). So it is clear enough that we take into consideration the probability of the observed value, but why do we also take into consideration the probability of the events that are more extreme than the observed value?
It seems to me that if we also take into consideration the events that are more extreme than the observed value, we are overestimating the p-value. I understand that we couldn't consider only the observed value if we are talking about a continuous distribution, since in that case we have to find the area under the curve to find the probability, and we would find the area of a line which would be $0$. But we could consider a small interval or something like that. And in the case of a discrete distribution we wouldn't have this problem, but we still take into consideration the events that are more extreme than the observed value.
So why does this work? I would really appreciate it if you could explain it like you would explain it to someone who is just starting with statistics, since that is the position that I am in.