Each indexed folder appears in the sidebar. Click the disclosure triangle to expand it and see its subdirectory tree.
When you select a folder in the sidebar, the photo grid shows all photos in that folder and all of its subdirectories. For example, if your folder is structured as:
Photography/
2024/
January/
IMG_001.jpg
IMG_002.jpg
February/
IMG_003.jpg
2025/
IMG_004.jpg
Selecting Photography shows all four photos. Selecting 2024 shows the three photos from January and February. Selecting January shows only the two photos in that specific directory.