Modules support defining subplugins which have their own capabilities in db/access.php
If a sub plugin creates capabilities they get added to the capabilities table and appears in the site permission editing, but the new permissions do not appear as permissions on their parent modules permission page.
I have tested this with Assignment Type and with Workshop Form and behaviour occurs for both. It will create the capabilities but not show them for the module they apply to.
To create a test sub-plugin permission I added a capability to the workshop rubric plugin. Code below, and also step increased the version.php to process update.
After adding this capability, when I brought up the Site Define Roles -> Edit Role the new capability appeared, however if I create a workshop activity and click Permissions these new capabilities do not appear, even though the context is CONTEXT_MODULE.