One of the most fascinating possibilities enabled by metamaterials is the strong reduction of the electromagnetic scattering from nanostructures. In dielectric nanoparticles, the formation of a minimal scattering state at specific wavelengths is associated with the excitation of photonic anapoles, which represent a peculiar type of radiationless state and whose existence has been demonstrated experimentally. In this work, we investigate the formation of anapole states in generic dielectric structures by applying a Fano-Feshbach projection scheme, a general technique widely used in the study of quantum mechanical open systems. By expressing the total scattering from the structure in terms of an orthogonal set of internal and external modes, defined in the interior and in the exterior of the dielectric structure, respectively, we show how anapole states are the result of a complex interaction among the resonances of the system and the surrounding environment. We apply our approach to a circular resonator, where we observe the formation of higher-order anapole states, which are originated by the superposition of several internal resonances of the system.