Stems are more important to forage quality than leaves in alfalfa. To understand lignin formation at different stages in alfalfa, lignin distribution, anatomical characteristics and transcriptome profile were employed using two alfalfa cultivars. The results showed that the in vitro true digestibility (IVTD) of stems in WL168 was significantly higher than that of Zhungeer, along with the significantly lower neutral detergent fiber (NDF), acid detergent fiber (ADF) and lignin contents. In addition, Zhungeer exhibited increased staining of the xylem areas in the stems of different developmental stages compared to WL168. Interestingly, the stems of WL168 appeared intracellular space from the stage 3, while Zhungeer did not. The comparative transcriptome analysis showed that a total of 1993 genes were differentially expressed in the stem between the cultivars, with a higher number of expressed genes in the stage 4. Of the differentially expressed genes, starch and sucrose metabolism as well as phenylpropanoid biosynthesis pathways were the most significantly enriched pathways. Furthermore, expression of genes involved in lignin biosynthesis such as PAL, 4CL, HCT, CAD, COMT and POD coincides with the anatomic characteristics and lignin accumulation. These results may help elucidate the regulatory mechanisms of lignin biosynthesis and improve forage quality in alfalfa.