There are different inheritance rules for states, transitions, triggers, guards, and actions.
The structure of a state in a subclass is a refinement of the same state of the superclass. This structure keeps state inheritance is strict. All states and their hierarchy are inherited by the statechart of the subclass.
You can add states to the derived statechart, as long as they do not violate the hierarchy in the statechart of the superclass. In practice, this means that a regular state cannot contain inherited substates.
In the following example, the leaf state s2 was refined and became an Or state. The states s1 and s2 on the right are the inherited states.

You can add And lines to inherited states (adding components). If you convert an inherited Or state into an And state, the Or state becomes an And state, and one of the components contains its substates. This conversion is an exception to the previous rule, where the state hierarchy is modified by introducing an orthogonal component. The component that reparents the substates is designated as "main." In the following example, s2 becomes an And state. The component containing s3 and s4 is the main component. The name of a component is the same as the name for the And state.
