In the search for high-energy density materials for Li-ion batteries, silicon has emerged as a promising candidate for anodes due to its ability to absorb a large number of Li atoms. Lithiation of Si leads to large deformation and concurrent changes in its mechanical properties, from a brittle material in its pure form to a material that can sustain large inelastic deformation in the lithiated form. These remarkable changes in behavior pose a challenge to theoretical treatment of the material properties. Here, we provide a detailed picture of the origin of changes in the mechanical properties, based on first-principles calculations of the atomic-scale structural and electronic properties in a model amorphous silicon (a-Si) structure. We regard the reactive flow of lithiated silicon as a nonequilibrium process consisting of concurrent Li insertion driven by unbalanced chemical potential and flow driven by deviatoric stress. The reaction enables the material to flow at a lower level of stress. Our theoretical model is in excellent quantitative agreement with experimental measurements of lithiation-induced stress on a Si thin film.