Whitespace counting is a useful rough measure, not a language-aware definition of a word.
Hyphens and apostrophes need an explicit policy; two reputable products may intentionally return different totals.
Unicode-aware segmentation matters most for languages that do not put an ASCII space between every word.
The full explanation
Paste the same paragraph into two word counters and you can get two answers. Neither is broken: a word is not a well-defined unit, and every tool has to pick a rule. The same is true of lines, of case conversion, and of the commas in a CSV — text looks simple and is full of decisions. Read the complete guide for the reasoning, examples and definitions behind this answer.