Once you deplete the available energy reserves of a muscle it starts feeding on itself, burning protein instead of sugar. When you do that, the muscle starts to produce lactic acid as a product of converting protein to energy. The lactic acid is toxic and painful. The muscle will hurt until it is able to purge the lactic acid. Part of the process causes the muscle to enlarge and store more energy for NEXT time, resulting in larger and stronger muscles which can work for a longer time.