Doesn't handle case preserving, case insensitive operating systems
On macOS, /path/to/dir is equivalent to /path/TO/dir because the filesystem is case insensitive but case preserving. However, the following function call returns nil instead of t:
(f-ancestor-of? "/path/to" "/path/TO/dir")
Handling such filesystems is generally hard or impossible on a library level. For example, there's no way to figure out whether /path/to and /path/TO will refer to the same directory without creating that directory. Maybe the docstring should just document that the comparison is purely lexical (except for converting the filenames to absolute names) and case-sensitive?
I think one way to handle such filesystems would be to have a variable that the user could set if they are on such a filesystem.
Leaving the problem to the user would also be reasonable, though.
This might be relevant:
* Lisp Changes in Emacs 26.1
[...]
** The new function 'file-name-case-insensitive-p' tests whether a
given file is on a case-insensitive filesystem.