In Lightroom Classic, clicking on a folder in the Folder panel displays not only the photographs in the selected folder, but also any photographs in subfolders. This may be confusing if you are accustomed to viewing images in the operating system or in Adobe Bridge where the default view would display the photographs in the folder and folder icons for any subfolders.
To change Lightroom’s default view to display only the photographs in a folder (hiding any images in subfolders) select the Library menu and disable Show Photos in Subfolders (or, on the Folders panle, click the + (plus) icon and disable Show Photos in Subfolders).
Note: With Show Photos in Subfolders off, the photo count (displayed in the Folder panel) will most likely change (because Lightroom is counting only the photos in the folder and does not include any photos in subfolders). If you store all of your images in subfolders, don’t be alarmed if the parent folder displays a count of zero (because it’s not counting the photos in the subfolders).