Another says that it is meant to salute to the three shrines, namely ujigami (a guardian god or spirit of a particular place in the Shinto religion) who is an ancestral guardian god, ubusunagami (guardian deity of your birthplace), who is the guardian god of your birthplace and the guardian god of your entire life, and chinju (local Shinto deity) who is the guardian god of the place where you live.
もともとは先祖代々の守護神である氏神様、出生地の守護神でありその人の一生の守り神である産土神様、現在住んでいる地域の守護神である鎮守神様の三つの神様に挨拶をする意味で三社詣でていた、という説。