In the first part the referee has asked the players to move back the required distance and the play restarts with the referees whistle. If an opposition player has moved forward, within 10 yards of the ball before the kick is taken it’s an offence and a retake.
In the second example the team has taken a quick free kick, in which case the referee has not asked anybody to move back the required distance (so how do the players know what 10 yards is?) and the play restarts without the referees whistle. As soon as the kick is taken it’s fair game for the opposition to intercept.