A generalized natural mode expansion theory for investigating arbitrary electromagnetic fields is presented. When an inhomogeneity is bounded with impenetrable boundaries, the field excited by arbitrary sources is expanded with a complete set of eigenmodes, which are classified into trapped modes and exterior modes. As the boundaries tend to infinity, trapped modes remain unchanged, while exterior modes form a continuum. In numerical studies, unbounded systems can be emulated by placing perfectly matched layers (PMLs) at finite extent. Simulation shows that only a few natural modes are prominent in expanding the excited field in a properly functioning device. Such a reduced modal picture can provide quick guidance as well as useful physical insight for engineering design and optimization of electromagnetic components and devices.