They are wrapped around pine trees, a custom that dates back to the Edo period.
[1] During the Edo period a gardener developed komomaki as a method of attracting a pest known as the "pine moth" in English.
Called matsugahera in Japanese, and Dendrolimus spectabilis scientifically, the moths eat pine needles which can weaken the tree.
[1] The Tokyo Imperial Palace and the Kyoto Imperial Palace no longer use komomaki, but they can be seen in nine traditional gardens in Tokyo as a seasonal marker (風物詩, fūbutsushi).
[1] They can also be seen on the pine trees in the KEK research organisation in Tsukuba, Ibaraki prefecture.