Why does TTH occur before THT more often in a sequence of coin flips? Premise: Flip a coin $n$ times, and record the flips in a string (e.g. $THTTHTTTTHHHTHTTTH$). Then, check if $TTH$ occurs before $THT$. In the aforementioned case, it does not.
I performed this with increasing $n$, from $4\to100$, each $10000$ times, and graphed it:

Count ($n$) on the $x$ axis, probability on the $y$ axis.
As you can tell, the probability quickly converges to roughly 0.33. What is the statistical reasoning behind this?
This seems quite counterintuitive to me, but I cannot tell why.
Note: in the above simulation I only took strings that contained both $TTH$ and $THT$ which explains why for $n=4$, $p=1$, as the only substring of 4 that contains both is $TTHT$.

This is easiest to see via states.  There are only $4$ relevant states (other than the end states).  We'll label these by how much of either $TTH$ or $THT$ you have in the current string.  Thus the states are $\emptyset, T, TT, TH$.  If $S$ is a state we'll denote by $P_S$ the probability that $TTH$ will come first given that you are in state $S$. The solution we seek is, of course, $P_{\emptyset}$.
We remark that $P_{TT}=1$ since it is impossible to throw $THT$ before $TTH$ given that you are in state $TT$.
Also, $P_{\emptyset}=P_T$ since nothing of significance happens until you throw that first $T$.
We get $$P_{\emptyset}=P_T=\frac 12\times P_{TT}+\frac 12\times P_{TH}=\frac 12+\frac 12\times P_{TH}$$
and $$P_{TH}=\frac 12\times 0 +\frac 12\times P_{\emptyset}=\frac 12\times P_{\emptyset}$$
And we easily deduce the solution $$P_{\emptyset}=\frac 23$$
