Hidden Sub-Components

If you start a new SketchUp model, open the Components panel, go to Component Sampler, select the car and place it in your model, you’d see both the car and the default scale figure if you show the In Model category of the Components panel. There are two components in the model. Easy peasy. Or are there?
If you double click on the car in the model and click its part, you can see in Entity Info that they too are components. The halves of the car, the wheels, the door, even the rearview mirrors: it’s all nested components.
If you copy a wheel and then back your way out of the car (Esc or double click outside the car) you can paste the copied wheel next to the car. This could represent your winter tires stacked in a corner of your garage. If you update the Component browser by collapsing it and re-expaning it, now you’ll also see the wheel appearing in the In Model category!
Why?
SketchUp is evidently hiding (some) sub components. But why? If you click on the little arrow in the top right of the Component browser, you can select Expand. This makes SketchUp show us all the sub-components, should you want that. This also illustrates why SketchUp by default hides them for us.

If you are modeling a house, with doors, windows, rafters, plumbing, furniture, plants, cars and everything else you see in an architectural model, you don’t want the list of your components to be flooded by nuts and bolts, by screws and rearview mirrors, by the knobs on the stove or the individual chunks of wood in the fireplace. Not to mention the individual leaves on your potted plants! In such a model, we think of the car, the stove or the fireplace as atom pieces. They are the parts we compose a model from, and their internal parts are (normally) irrelevant to us.
On the rare occasions we want to use these interior parts, maybe for the extra pile of tires in the garage or firewood next to the fireplace, it's easy to double click into the parent component to grab a copy.
How?
How does this work on a technical level, and how can we use it as extension developers?
When all instances of a component definition are located within other component definitions that are associated with file paths, SketchUp hides them in the Component browser. It’s assumed that the component with the associated file path, e.g. a car you imported from your component library or 3D Warehouse or some other source, is the smallest building block you care about. The rule itself can sound complicated and you may need to read it again, but if you think of the rationale behind the rule, it hopefully makes a lot of sense.
In case you have an extension that lists components similar to the Component panel, maybe a reporting tool or a component library search tool, you can also hide these sub components. You could also add a somewhat discrete button to display them in the rare cases the user actually wants to see them.
Chapters
# Let the user control this somewhere, but default to hiding
show_subcomponents = false
Sketchup.active_model.definitions.each do |definition|
# Groups and Images technically use component definitions in SketchUp,
# but in the user mental model they are not components, and should be hidden.
next if definition.group?
next if definition.image?
# Hide sub-components of linked components.
# SketchUp even offers a nice API call so we don't have to implement this
# rule ourselves :) .
next if definition.hidden? unless show_subcomponents
# Display the component definition to the user somehow.
puts definition.name
end
Some extensions implementing this behavior are Eneroth Reference Manager and Holygon Compfire.
Other ways to hide internal parts
There are scenarios where this method to hide internal parts from the Components browser doesn’t work. This approach of hiding interior parts assumes the parent considered to be the basic building block is associated with a file path.
For instance, if your extension creates parametric objects that are expected to be edited by entering values or dragging sliders in a dialog, you probably don't want the user to pick the individual internal parts from the Components panel, place them elsewhere in the model and possibly make manual changes to them. Such changes would clash or get overridden by parametric changes made in the dialog. However, if these parametric objects are drawn within the active SketchUp model, they typically have no file path association.
In a case like this, groups can be a good option! In SketchUp, a Group is similar to a Component but with some different behaviors. While a component represents a class of identical objects - edit one and the changes apply to all - groups typically resemble unique or place-built objects. Technically copies of the same group use a shared definition - just like components do - so there is no file size penalty to using groups. However, groups are silently made unique when being edited, and are excluded from the component panel.
Thoughts
Personally I think hiding these sub components is a great example of SketchUp’s wonderful design. You can use SketchUp for years without noticing these components are hidden. But the day you make your own tool that lists In Model components, you see a bunch of internal junk. Or maybe you found the Expand option by chance when exploring the menus. But I’m almost certain you didn’t miss any of the nested components in the list. Similarly to Component Definition GUIDs and camera control, SketchUp does what you want, and does it so well and elegantly you don't even realize it.
Further Reading