The reason for that is that P-waves (primary waves) travel faster than S-waves (secondary waves).
If we call [tex]v_p[/tex] the speed of the primary waves and [tex]v_s[/tex] the speed of the secondary waves, and we call [tex]S[/tex] the distance of the seismogram from the epicenter, we can write the time the two waves take to reach the seismogram as
[tex]t_P = \frac{S}{v_P} [/tex]
[tex]t_S= \frac{S}{v_S} [/tex]
So the lag time between the arrival of the P-waves and of the S-waves is
[tex]\Delta t = t_S-t_P= \frac{S}{v_S}- \frac{S}{v_P}= S(\frac{1}{v_S}- \frac{1}{v_P}) [/tex]
We see that this lag time is proportional to the distance S, therefore the larger the distance, the greater the lag time.