The self-assembly of supramolecular hydrogels has attracted the attention of many researchers, and it also has a broad application prospect in biomedical fields. However, there are few studies on the intrinsic mechanism of molecular self-assembly of hydrogels. In this paper, the self-assembly process of glycolipid-based hydrogels is studied by combining quantum chemistry calculation and molecular dynamics simulation. Using quantum chemistry calculation, the stable stacking mode of gelator dimers was explored. Then, by varying the water content in the gelation system, three different morphologies of hydrogels after self-assembly were observed on the nanoscale. When the water content is low, the molecular chains were entangled with each other to form a three-dimensional network structure. When the water content is moderate, the system had obvious stratification, forming the typical structure of “gel-water-gel”. The gelators can only form small micelle-like agglomerations when the water content is too high. According to the analysis of the interaction between gelators and that between gelators and water molecules, combined with the study of the radial distribution function and hydrogen bonding, it is determined that the hydrogen bonds formed between gel molecules are the main driving force of the gelation process. Our work is of guiding significance for further exploration of the formation mechanism of a hydrogel and developing its application in other fields.