By performing MHD simulations, we investigate the mass loss of intermediate-and low-mass stars from MS to RGB phases. Alfvén waves, which are excited by the surface convections, travel outwardly and dissipate by nonlinear processes to accelerate and heat the stellar winds. We dynamically treat these processes in open magnetic field regions from the photospheres to '25 stellar radii. When the stars evolve to slightly blueward positions of the dividing line (Linsky & Haisch), the steady hot corona with temperature T % 10 6 K suddenly disappears. Instead, many hot ($10 6 K) and warm (k10 5 K) bubbles are formed in cool (T P 2 ; 10 4 K) chromospheric winds because of thermal instability; the red giant wind is not a steady stream but structured outflow. As a result, the mass-loss rates,Ṁ , largely vary in time by 3Y 4 orders of magnitude in the RGB stars. Supported by magnetic pressure, the density of hot bubbles can be kept low to reduce the radiative cooling and to maintain the high temperature a long time. Even in the stars redward of the dividing line, hot bubbles intermittently exist, and they can be sources of UV/soft X-ray emissions from hybrid stars. Nearly static regions are formed above the photospheres of the RGB stars, and the stellar winds are effectively accelerated from several stellar radii. Then, the wind velocity is much smaller than the surface escape speed because it is regulated by the slower escape speed at that location. We finally derive an equation that determinesṀ from the energetics of the simulated wave-driven winds in a forward manner. The relation explainsṀ from MS to RGB and can play a complementary role to the Reimers formula, which is mainly for more luminous stars.