widgets are only front end, i.e. can only be used on pages.
modules can include one or more widgets, but can also have server side features like microflows, java actions, scheduled events, etc. in addition to domain models for data usage.
You have the concept right.
A module is a grouped set of functionality. In that module you could have data, logic, pages, even widgets included. When we want to deliver backend, end-to-end, or even a package of front-end functionality, that could all come in the form of a module.
A widget is a UI component that can be used on a page. You’ve got that right.