The formation of Kimmelstiel-Wilson nodules is primarily due to chronic hyperglycemia, which leads to the thickening of the glomerular basement membrane and increased deposition of extracellular matrix proteins. This process is mediated by advanced glycation end-products (AGEs) and various growth factors such as transforming growth factor-beta (TGF-β).