This tool tokenizes both texts into words, whitespace, and punctuation, then runs a classic longest-common-subsequence (LCS) comparison to find the largest set of tokens both versions share in the same order. Everything outside that shared sequence is either something the original had that the edit removed, or something the edit introduced that wasn't there before.
Because punctuation is tokenized separately from the words around it, a change as small as a comma or a swapped period still shows up precisely, instead of being absorbed into a broader "whole sentence changed" block the way a cruder diff might report it.