In the early 1990s, it was found that the strongest disturbances of the space–weather were associated with huge ejections of plasma from the solar corona, which took the form of magnetic clouds when moved from the Sun. It is the collisions of the magnetic clouds with the Earth’s magnetosphere that lead to strong, sometimes catastrophic changes in space–weather. The onset of a coronal mass ejection (CME) is sudden and no reliable forerunners of CMEs have been found till date. The CME prediction methodologies are less developed compared to the methods developed for the prediction of solar flares. The most probable initial magnetic configuration of a CME is a flux rope consisting of twisted field lines which fill the whole volume of a dark coronal cavity. The flux ropes can be in stable equilibrium in the coronal magnetic field for weeks and even months, but suddenly they lose their stability and erupt with high speed. Their transition to the unstable phase depends on the parameters of the flux rope (i.e., total electric current, twist, mass loading, etc.), as well as on the properties of the ambient coronal magnetic field. One of the major governing factors is the vertical gradient of the coronal magnetic field, which is estimated as decay index (n). Cold dense prominence material can be collected in the lower parts of the helical flux tubes. Filaments are, therefore, good tracers of the flux ropes in the corona, which become visible long before the beginning of the eruption. The perspectives of the filament eruptions and following CMEs can be estimated by a comparison of observed filament heights with calculated decay index distributions. The present paper reviews the formation of magnetic flux ropes, their stable and unstable phases, eruption conditions, and also discusses their physical implications in the solar corona.