Is there a difference [?]
Yes.
A non-nested class, even if in the same file, is an independent top-level class. It has no special relation to the file class of the same name.
Nested classes can access members of the class in which they are nested, and vice versa. (If the nested class is static, it needs an instance of the outer class to access the instance fields.)
Nested classes can be accessed by name from other compilation units. But usually only the top-level class of the same name can be obtained by name from other compilation units.
And more importantly, is there a legitimate use of this paradigm?
It supports backward compatibility with files written in Java 1.0 before nested classes were introduced in version 1.1. That was about 20 years ago. This case does not occur very often.
Other than that, I personally never found a need for it. A typical template is to put a class and its helper classes in a single file.
References
source share