This is from the law of conservation of energy, in this case of mechanical energy.
Because there is no friction assumed, energy is not consumed for friction AND rotation of the bob didn't change. So there are two types of energy that can change: kinetic and potential, and the sum of them is conserved.
Kinetic energy is (1/2)*m*v^2 and potential is m*g*h where
m is the mass (a constant here), v is the velocity, g is the acceleration of gravity (constant) and h is the height over some fixed level (say, the level of the table).
(1/2)*m*(v_P)^2 + m*g*h_P = (1/2)*m*(v_Q)^2 + m*g*h_Q.
Because h_P = h_Q we obtain
(1/2)*m*(v_P)^2 = (1/2)*m*(v_Q)^2
v_P = v_Q (they are absolute values of velocity and both >=0).