Achievements were part of the Xbox 360 operating system when it first launched. Due to demand, Sony released them on the PS3 in the form of trophies. Trophies were not originally part of the PS3 operating system. When a trophy is unlocked on the PS3 it can often take a few seconds before the trophy actually unlocks. These few seconds can be a stressful moment when you are going to a trophy that can often glitch out.
The exact technical reasons as to why there is a delay with the unlocking of trophies on the PS3 is unknown. If it was possible to make them unlock instantly, im sure Sony would have done so, as trophies unlock instantly on the PS4. Here are a few possible causes as to why trophies are slow to unlock on the PS3.
The operating system has a finite amount of hardware resources that it can use. These were all assigned to other things that need the hardware. When trophies came along, the operating system was already using 100% of the resources it had assigned to it. The programmers were likely able to free up a few % by taking it away from other things and they were then able to give this to the trophy system, but it wasnt enough to make it work in real time. There is likely a service that runs every few seconds (eg, every 5 seconds check to see if a trophy requirement has been met). Sometimes you might hit the requirement 4 seconds after the last check, which means the trophy will unlock almost instantly. Other times it might check and you have not gotten a trophy, but you get that last headshot a milisecond after. You then have to wait another 5 seconds before it checks again.
There could also be other decisions that are design related, and it might be possible to make it work faster of Sony were to completely redesign the trophy system, but this is a huge amount of money for very little gain. It works now and thats all that matters. They learned from their mistakes and implemented it correctly on the PS4 and Vita.