As I explained, component definitions have no layer assignment.
Only their placed instances can have layers.
A group is a special kind of component which does not appear in the Components Browser and its instance is always made unique, at least once it’s edited.
Because a group is a type of instance it can have a layer.
The placed component-instance is assigned to Layer0 [i.e. NO layer] by default, you can manually assign another layer later, or have the ‘current’ layer changed before you place it [remembering to swap back to Layer0 so that lines and faces you draw are kept with Layer0 assigned].
The layer of the group nested inside the component’s definition can be assigned to any layer you choose when creating it.
Switching OFF that layer should leave the compo’s contents hidden.
There is no way*** of setting a component-instance’s layer BEFORE it is manually placed, but you can set the layer of nested groups etc within its definition…
***You could use the Ruby API to do this… but it’s then dependent on all using having it set up !