I think you should make a clarification here: Let's denote $C_1$ the state where we use the unfair coin and $C_2$ when we flip the fair coin. Thus, the transition matrix will be something like that:
$$P = \begin{array}{l|ll}
& C_1 & C_2 \\\hline
C_1 & 0.6 & 0.4 \\
C_2 & 0.5 & 0.5
\end{array} \implies P^4 = \begin{bmatrix}
0.5556 & 0.4444\\
0.5555 & 0.4445
\end{bmatrix}
$$
$P^4_{12} = 0.4444 $ is the probability to reach $C_2$ in exactly 4 tosses when we start from $C_1,$ which means we will flip the second coin on the 5th toss.
The transition matrix reads: $P(X_n=0\to X_{n+1}=0)=\frac12$, and $P(X_n=0\to X_{n+1}=1)=\frac12$, and $P(X_n=0\to X_{n+1}=2)=0$. This is me reading off the first row.
In the context, this means the probability of going from $0$ successive heads to $0$ successive heads is $\frac12$ which makes sense, since this is the probability of rolling a tails. The probability of going from $0$ successive heads to $1$ successive head is also $\frac12$ since this is probability of hitting heads. Finally, probability of going from $0$ successive heads to $2$ successive heads is obviously not possible in one toss, so this probability is $0$.
Similarly, you can read off the other two rows.
Judging by the last row, this game ends when you get $2$ successive heads, since from here it can never go back down to $0$. I suppose this must have been in the question.
EDIT:
In an attempt to explain this better, I will also go through the second row.
Firstly, we must recognise what the columns and rows mean. The row represents the state in which we start - so the first row represents starting in the state of having $0$ successive heads, etc. The column represents the state in which we finish after $1$ toss of a coin. So the second column represents finishing with $1$ successive head, which means you used to have none, and you have just rolled a heads.
Now, the second row is $$\left(\begin{matrix}\frac12 & 0 & \frac12 \end{matrix}\right)$$
The first element in this represents the probability of going from the state of $1$ successive heads to $0$ successive heads (row $2$ corresponds to starting with $1$ successive heads, column $1$ corresponds to ending with $0$ successive heads). Clearly, to go from having $1$ successive heads to having none means we rolled a tails, which has probability $\frac12$.
The second element in this represents the probability of going from the state of $1$ successive heads to staying in this state. But we must toss the coin, and as I wrote in the comments, no matter what we get from the toss, we must change - rolling heads means we now have $2$ successive heads, rolling tails means we now have none (as described above). So we see it is impossible to stay in this state, hence why this entry is $0$.
Finally the third element represents the probability of going from $1$ successive heads to $2$. This of course happens when we roll a heads, which has probability half.
I hope this helped to simplify it.
Best Answer
You're entirely correct about how they went from line 1 to line 2. Since the only possible values of $X_{0}$ are $1,2$, $$\mathbb{P}(X_{3}=1) = \mathbb{P}(X_{3}=1 \cap X_{0}=1) + \mathbb{P}(X_{3}=1 \cap X_{0}=2)$$ and from there, using $\mathbb{P}(A \cap B) \equiv \mathbb{P}(A|B)\mathbb{P}(B)$ the second line is obtained.
As for the last line, the matrix component $P_{ij}$ here represents the probability that we transition from state $i$ to state $j$ after one flip; similarly, $P^{3}_{ij}$ represents the probability from transitioning from state $i$ to state $j$ after 3 flips, which we can also write as $\mathbb{P}(X_{3}=j|X_{0}=i)$.
The whole point of the matrix formulation is so you can represent your probability state as a row vector $x$. In this case, initially $x = \left(\array{\frac{1}{2} &\frac{1}{2}}\right)$ since you are equally likely to start with either coin. By right-multiplying by $P^{n}$, the resulting row vector gives the probabilities of using each coin on the $n$th flip.