I am impressed by this ability too. I am really challenged to decipher some people's handwriting, and yet, by context, I can usually make sense of it. Beyond that though, I don't know why, other than it has something to do with pattern recognition.
The legibility of my handwriting varies considerably. Some of my notes will be done in block letters and they look like they they were printed with some sort of stencil - very consistent letter shapes and sizes, and possibly machine-readable.
But then there are times when I'm in a real hurry, and they look like chicken scratch. For example, my shorthand for words ending with "ation" is to simply replace those letters with a line that may be straight, or wavy.
situ____
or
situ~~~
It would be a good program that deciphers that.
ETA: Looks like an interesting article, 01~~~~
