The function of a torii is to mark the entrance to a sacred space. For this reason, the road leading to a Shinto shrine (sandō) is almost always straddled by one or more torii, which are therefore the easiest way to distinguish a shrine from a Buddhist temple.
(Retrieved from: https://en.wikipedia.org/wiki/Torii)