The exact pathogenesis of rimmed vacuoles is not entirely understood, but they are believed to result from defective autophagy and protein degradation pathways. In diseases like IBM and HIBM, mutations in genes related to these pathways, such as GNE or VCP, lead to the accumulation of misfolded proteins and other cellular debris, forming the rimmed vacuoles.