We study the cosmology of the dark sector consisting of (ultra)light scalars. Since the scalar mass is radiatively unstable, a special explanation is required to make the mass much smaller than the UV scale. There are two well-known mechanisms for the origin of scalar mass. The scalar can be identified as a pseudo-Goldstone boson, whose shift symmetry is explicitly broken by nonperturbative corrections, like the axion. Alternatively, it can be identified as a composite particle like the glueball, whose mass is limited by the confinement scale of the theory because no scalar degree of freedom exists at high scales. In both cases, the scalar can be naturally light, but interaction behavior is quite different. The lighter the axion (glueball), the weaker (stronger) its interaction. As the simplest nontrivial example, we consider the dark axion whose shift symmetry is anomalously broken by the hidden non-Abelian gauge symmetry. After the confinement of the gauge group, the dark axion and the dark glueball get masses and both form multicomponent dark matter. We carefully consider the effects of energy flow from the dark gluons to the dark axions and derive the full equations of motion for the background and the perturbed variables. The effect of the dark axion-dark gluon coupling on the evolution of the entropy and the isocurvature perturbations is also clarified. Finally, we discuss the gravothermal collapse of the glueball subcomponent dark matter after the halos form, in order to explore the potential to contribute to the formation of seeds for the supermassive black holes observed at high redshifts. With the simplified assumptions, the glueball subcomponent dark matter with the mass of 0.01-0.1 MeV and the axion main dark matter component with the decay constant f(a) = O(10(15)-10(16)) GeV and the mass of O(10(-14)-10(-18)) eV can provide a hint on the origin of the supermassive black holes at high redshifts.