Basically the modules help you to encapsulate your code. If you have one or more packages perform some black box magic, you can hide it behind a public API and have your module explicitly export that API package. Or you can set-up your code as a service provider/consumer via java.util.ServiceLoader. You do have to specify and dependencies in the module-info files for each module, as well as in the build scripts. You also have to be careful to avoid modules depending on each other.
Hope this helps some... it is a bit difficult to find examples but I did find some when I was working on a sample module project. Here is one source I used
java modules