This is quite simple, but not something I realised was possible. If you have lots of documents (or indeed list items) and want to assign categories and sub-categories, you can easily add a few additional metadata columns. Then by editing the view you can create nested groups. I may have just never needed to do this, but always thought you could only have one level of group in a view.
So if you have something like this:
Imagine lots of documents, and this list becomes very unmanageable very quickly
You can make it easy to navigate for your end users by using nested grouping. The end result looks a bit like this:
Set all groups to be collapsed as the default and the initial view is a lot easier to manage
The only real downside to this type of thing is that you can't have cascading categories and sub categories, not without exploring managed metadata. Managed metadata is great for many things, but before looking at it you need to fully understand its limitations.