When we say that a missile has been locked on a target (lets assume a fast moving target, and that the missile is mounted on a fast moving plane), we assume that once the missile has been locked onto the target, it will actually hit the target after firing (Irrespective of the subsequent changes in the position, velocity and acceleration of the target). How does this system work?
This will be very generic...
It depends on what type of missile it is: either IR or radar-guided.
With IR missiles, the missile is caged and locked at missile boresight. The missile is commanded to the aircraft cueing system. When the target enters the missile's FOV, the pilot uncages the seeker head, at this point you will hear a loud, "whiney" audible tone. The missile then transfers to track mode. The pilot pickles... the missile batteries become operational, fins are unlocked, autopilot takes over, midbody connector is retracted, then ignition is commanded.
With radar-guided missiles, it depends on the missile and what type of radar they have. Usually the radar is slewed to a target and locked up. When the pilot pickles, the missiles is either receiving data from the aircraft via datalink or is in active mode with the missile's radar tracking the target. Eventually the missile's radar will take over and track the target. The datalink can be terminated early by the pilot if the missile's radar can take over allowing for some pretty cool tactical stuff.
Long answer: There is A LOT more to it, but this is very basic. Tread very lightly with questions like this. A lot of the stuff (especially numbers) with regards to weaponry and modern threats are classified. And even though some of the stuff isn't classified, it's still OPSEC and shouldn't really be discussed on an internet forum.
Missiles use advanced algorithms to predict the best path to intercept the target. The seeker-head in the missile will be looking at the target (either IR, reflected radar energy, or using it's own radar depending on the missile type) and attempt to guide itself to the predicted intercept point, in order to have the shortest possible distance to cover. It basically flies towards an intercept point ahead of the target aircraft. When the target aircraft direction changes, so does this predicted intercept point, and the missile manoeuvres to fly towards the new intercept point. this is of course a continuous event.
Furthermore missiles usually have multiple stages of guidance. In the beginning they will fly just in the general direction in order to save energy, and only in the later stages will it start manoeuvring to the intercept point.