I remember back when Java was introduced, I used to program in Visual C++, and it was a pain to find classes in your source, or use some sort of naming convention. You had to basically use "Find all files" feature of WIndows (which was a pain too) if the project didn't have a naming convention. Nowadays, it doesn't matter because computers have grown powerful enough that IDEs can keep track of where all the classes are. Also back in the day, you had to compile your entire source code every time....and you liked it! Each .cpp file compiled into an .obj file, and then a linker would link all the files into an .exe file. The final link step had to execute every time. IDEs tried to be as lightweight as possible, because the compiler took so much goddammed memory.
Java introduced the rule that there can be only one class per java file, the folder structure of the source folder matched the package name exactly, and each java file compiles into couple of classes because it made sense for the IDEs at the time. When you opened a class, all the
IDE had to do is use the package name to traverse the folder structure to find the file. When you changed the file, all it had to do is compile these one file into a class file without requiring an additional link step. This rediced the size of the compiler too.. because all the compiler has to do is load this one file and it's dependencies to compile the class. It doesn't need to load everything into memory. This led to more memory being available to the Editor.
Hmm now that I think about it, having a well defined rule for how source files are stored, lead to the copiler becoming lightweight, which lead to the IDEs having more features, which includes being able to keep track of where all the classes are stored, which lead to people asking "Why do we need a rule for how source files are stored?"