The primary function of keratohyalin granules is to facilitate the aggregation of keratin filaments into dense bundles, a process essential for the formation of the protective barrier of the skin. The proteins within these granules, such as profilaggrin, are processed into smaller units like filaggrin, which bind keratin filaments together. This process is critical for the structural integrity and water-retentive properties of the epidermis.