How does a Missile Lock Work?
Short Answer:

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.