IIRC, when the DOS/Windows shell needs to resolve "program" to either "program.com" or "program.exe", the .com file takes precedence - ISTR this being abused by malware once upon a time.
I'm guessing it's because `example.com` comes before `example.exe` when you sort alphabetically? So when it goes looking for `example`, it gets the list of files and takes the first matching one it sees.