The main component of the s process is produced by low mass stars (1.5⩽M/M⩽3), when they climb for the second time the red giant branch and experience a series of He shell flashes called thermal pulses. During the relatively long period (105 yr) that elapses between two subsequent thermal pulses, a slow neutron flux is provided by the 13C(α,n)16O reaction taking place within a thin 13C pocket located in the He-rich and C-rich mantel of these stars. A second, marginal, neutron burst occurs during the thermal pulse and it is powered by the 22Ne(α,n)25Mg reaction. We review the present status of the nucleosynthesis models of low mass AGB stars. The advance in the knowledge of the complex coupling between convective mixing and nuclear process, which allows the surface enrichment of C- and s-process elements, is presented, together with the hypotheses concerning the physical mechanism driving the formation of the 13C pocket. In order to illustrate the capabilities and the limits of the theory, an updated computation of a 2M stellar structure with solar chemical composition is reported. This model has been obtained by including a full nuclear network (from H up to Bi, at the termination point of the s-process path) into the stellar evolution code. The predicted modification of the surface composition occurring during the AGB evolution is shown. The new challenge of AGB modeling, namely, the study of C-rich and s-rich very metal-poor stars, is discussed.