Let's say we have many files stored in the file system which are referenced in other places like a database. Here in the DB, we will have the file path. However if we don't have a specific methodology to store these files, then accessing them can be less efficient. Means, if we use one folder for all the files where there could be a huge number of files, this can lead to potential issues. Accessing files using direct link can still be fast, but when viewing them from the GUI can cause problems. Indexing, searching also becomes less efficient.
So to solve this, we can use a naming convention that acts like a hash bucket. Say each file in the DB has a unique string identifier. For example, a UUID, 1a72c934-a1a0-4d22-9461-fc348a22ff9b. Here depending on the files we anticipate, we can either use the first two characters of this identifier or three for the folder name and then place this file in that folder. When we get another UUID that starts with the same character string, the file goes to the same folder. This makes directory access efficient reducing the number of files in each directory and provides a logical organization for files.