First some notation:
Let $(X,E,P)$ denote a finite, irreducible Markov chain with finite state space $E$ and transition matrix $P$. Choose and fix a subset $E^°$ of $E$, which will be called the interior of $E$. The complement $\Theta E=E\setminus E^°$ will be called the boundary of $E$. Henceforth we will assume that both $E^°$ and $\Theta E$ are non-empty. We also assume that $E^°$ is connected in the sense that $P_{|E^°}=(p_{x,y})_{x,y\in E^°}$ is irreducible. Note that this latter matrix is a substochastic matrix.
Now to the Maximal Principle.
Let $h$ be a harmonic function on $E^°$ and $M=\max\left\{h(x): x\in E\right\}$. Then there exists a $y\in\Theta E$ such that $h(y)=M$. Moreover, if $h$ is non-constant, then $h(x)<M$ for all $x\in E^°$.
Here is the proof: We set $$ \tilde{P}=(\tilde{p}_{x,y})_{x,y\in E},\text{ where } $$ $$ \tilde{p}_{x,y}=p_{x,y}\text{ if }x\in E^°\text{ and }y\in E,\\ \tilde{p}_{x,x}=1\text{ if }x\in\Theta E\text,\\ \tilde{p}_{x,y}=0\text{ if }x\in\Theta E\text{ and }y\neq x. $$
Since $P$ is irreducible, we have that $\tilde{P}$ is irreducible. Notice that, by construction, $h$ is harmonic on $E^°$ with respect to $P$ if and only if $h$ is harmonic on $E^°$ with respect to $\tilde{P}$.
Suppose that there exists $x\in E^°$ with $h(x)=M$. Let $x'\in E$ be arbitrary. By irreducibility, for some $n\in\mathbb{N}$, it is $\tilde{p}_{x,x'}^{(n)}>0$. Thus \begin{align} M&=h(x)=\tilde{p}_{x,x'}^{(n)}h(x')+\sum_{y\in E\setminus\left\{x'\right\}}\tilde{p}_{x,y}^{(n)}h(y)\\ &\leqslant \tilde{p}_{x,x'}^{(n)}h(x')+\sum_{y\in E\setminus\left\{x'\right\}}\tilde{p}_{x,y}^{(n)}M\\ &\leqslant \tilde{p}_{x,x'}^{(n)}h(x')+(1-\tilde{p}_{x,x'}^{(n)})M. \end{align} Therefore, we have that $h(x')=M$ and so $h$ must be constant. In particular, if $h$ is non-constant, it cannot obtain its maximum on $E^°$.
1.) My main problem with this proof is to understand why we switch over to the new transition matrix $\tilde{P}$. I do not see why we do this. Do you see that and could explain that to me?
2.) Why isn't the last $\leqslant$ a $=$?
With greetings and best wishes
The Maximal Principle said "Let $h$ be a harmonic function on $E^°$...". So $h$ is not guaranteed to be a harmonic function on $\Theta E$ with respect to the transition matrix $P$. The new transition matrix $\tilde{P}$ has the property that $h$ is a harmonic function on $E$ with respect to $\tilde{P}$. We can only replace $p_{x,y}$ in $h(x)=\sum_{y\in E}p_{x,y}h(y)$ by $p_{x,y}^{(n)}$ if $h$ is harmonic on $E$.
Sadly, the statement and its proof are nevertheless buggy, because $\tilde{P}$ is not irreducible on $E$ (even if $P$ were irreducible on $E$). What would be needed is that each point of $\Theta E$ be connected directly to some point of $E^°$.
You are right, the last $\leqslant$ can be replaced by a $=$.