I don't understand the solution he gives. Please turn to PDF page 20

The author says (first paragraph)

Now I don't understand how sure we know it is x. Why can't it be X + 2, or X + 1500??

Later he says total length of the string is L, so it assumes that the entire system is actually running with one single string?? The given did not say that, and the diagram did not show that either.
In solving this problem, what do we have to think first? it seems very insightful that one sees the relationship in distance.

The position of the mass m2 is also measured by x as the distance moved by the block m2 is same as the pulley.Of course the absolute distance differs but the change is the same.

And the length of the string is a constant. I don't see your point about running with a single string. They are clearly talking of the left string.

How does this system works?
You see, with one single pulley, i know that m1 and m2 will travel the same distance, one moves forward and one moves downard

now, back to this problem. how does this system works? I see a second string connected from P1 to pulley P2.

So when m1 moves, what happen to the second string, how does it respond?

You may be aware that such problems are studied under Constraint motion. Here the only constraint is that the string is inextensible.
It is often possible to see the constraint from the diagram itself. Here the mass m2 moves x so p2 moves x. But you see the string is wrapped round the pulley o both sides so that its length would seem to increase by 2x. Since the string can not actually increase in length it will compensate by moving the block m1 by 2x.You see the wall to which p1 is attached can not move.

But these are elementary ways. A trained eye is a must for such questions. If you are familiar with rotational mechanics, this is an interesting application of Chasle's Theorem for general motion. The upper part of p1 in contact with the string is always at rest in same way as the bottom of a rolling ball is. Then velocity of the bottom point is 2v.You get the same result.