Why the error probability is given by this expression?
A whole chapter of a book can be written to answer the "Why" in this question but the
short answer is that if the signals used are an antipodal signal set (meaning 
bits $0$ and $1$ are transmitted using signals $s_0(t)$ and $s_1(t)$ respectively
where $s_1(t) = -s_0(t)$ and the signals are of duration $T$ and energy $E$,
then with matched filtering, the receiver makes a decision that $0$ was transmitted
or a $1$ was transmitted according as the sample value from the matched filter
is positive or negative.  The sample value is a random variable $X$ whose
distribution is $\mathcal N\left(\pm \sqrt{E}, N_0/2\right)$ depending on whether
a $0$ or a $1$ was transmitted. If $X$ has mean $-\sqrt{E}$ when a $1$ is transmitted,
then the probability of error is
$$\begin{align*}
P_{e,1} &amp;= P\{X &gt; 0 \mid 1~\text{transmitted}\}\\
&amp;= P\left\{\mathcal N\left(-\sqrt{E}, N_0/2\right) &gt; 0\right\}\\
&amp;= Q\left(\frac{0 - \left(-\sqrt{E}\right)}{\sqrt{N_0/2}}\right)\\
&amp;= Q\left(\sqrt{\frac{2E}{N_0}}\right).
\end{align*}$$
Similarly, $X$ has mean $\sqrt{E}$ when a $0$ is transmitted,
and so the probability of error is
$$\begin{align*}
P_{e,0} &amp;= P\{X &lt; 0 \mid 0~\text{transmitted}\}\\
&amp;= P\left\{\mathcal N\left(\sqrt{E}, N_0/2\right) &lt; 0\right\}\\
&amp;= \Phi\left(\frac{0 -\sqrt{E}}{\sqrt{N_0/2}}\right)\\
&amp;= \Phi\left(-\sqrt{\frac{2E}{N_0}}\right)\\
&amp;= Q\left(\sqrt{\frac{2E}{N_0}}\right).
\end{align*}$$
Finally, using the law of total probability, the probability of error is
$$P_e = P_{e,0}P\{0~\text{transmitted}\}
+ P_{e,1}P\{1~\text{transmitted}\} = Q\left(\sqrt{\frac{2E}{N_0}}\right)$$
regardless of the probabilities of transmitting $0$'s and $1$'s.
For more details such as why the matched filters outputs
are as stated above, see, for example, this lecture 
note and 
this one
of mine.