Type II and anomalous Cepheids (ACs) are useful distance indicators when there are too few classical Cepheids or when RR Lyrae stars are too faint. Type II and ACs follow a period-luminosity relation as well, but they are less well-studied classes of objects. In this paper we study the sample of 335 Type II and ACs in the Small and Large Magellanic Clouds detected in OGLE-III data. The spectral energy distributions (SEDs) are constructed from photometric data available in the literature and fitted with a dust radiative transfer model, thereby leading to a determination of luminosity and effective temperature. In addition, a subsample of targets is investigated for possible binarity by looking for the light-time travel effect (LITE). Hertzsprung-Russell diagrams (HRD) are constructed and compared to evolutionary tracks and theoretical instability strips (ISs). In agreement with previous suggestions, the BL Her subclass can be explained by the evolution of ~0.5-0.6M_{sun}_ stars evolving off the zero-age horizontal branch and the ACs can be explained by the evolution of ~1.1-2.3M_{sun}_ stars. The evolution of the W Vir subclass is not clear. These objects are at higher luminosities than ACs and evolutionary tracks of ~2.5-4M_{sun}_ stars cross this region in the HRD, but the periods of the W Vir are longer than those of the short period classical Cepheids at these luminosities, which indicates the former have lower masses. A low-mass star experiencing a thermal pulse when the envelope mass is small can make a blue loop into the IS region of the W Vir stars. But the timescale is extremely short, so this is also no explanation for the W Vir as a class. A relation to binarity might be at the origin of the W Vir stars, which has already been explicitly suggested for the peculiar W Vir stars. For ~60% of the RV Tau and ~10% of the W Vir objects an infrared excess is detected from the SED fitting. A recent result is confirmed that stars exist with luminosities below that predicted from single-star evolution, which show a clear infrared excess, and the shape of the excess suggests a connection to binary evolution. The investigation of the LITE effect revealed 20 systems that appear to show periodic variations and may be new binaries, although this study requires follow-up. About 40 stars show significant period changes.