While shrines were built and festivals were held on the premises later, ancient shrines had tamagaki within the building and placed tokiwagi (evergreen such as sakaki) where a divine spirit resides and was enshrined.
次第に神社が建てられるようになり、祭りも社殿で行われるようになったが、古い形の神社は、建物の中に玉垣を設けて常盤木（常緑樹、つまり榊など）を立てて神の宿る所とし、祭るものであった。