Just move your mouse to the top folder and hovver over the expand / collapse arrow, then press and hold the [Option] key (bottom left of keyboard) while you left click your mouse. If you click a second time it will expand all folders. You can also do this on subfolders., and it also works in Navigator.
You don't have a signature, so I don't know which version of AC you are running, but it definitely works as far back as AC24.
Apple iMac macOS Ventura / AC26UKI (most recent builds)