Sir James George Frazer (1854–1941).  The Golden Bough.  1922.

§ 7. Death and Revival of Vegetation
THESE Russian customs are plainly of the same nature as those which in Austria and Germany are known as “Carrying out Death.” Therefore if the interpretation here adopted of the latter is right, the Russian Kostrubonko, Yarilo, and the rest must also have been originally embodiments of the spirit of vegetation, and their death must have been regarded as a necessary preliminary to their revival. The revival as a sequel to the death is enacted in the first of the ceremonies described, the death and resurrection of Kostrubonko. The reason why in some of these Russian ceremonies the death of the spirit of vegetation is celebrated at midsummer may be that the decline of summer is dated from Midsummer Day, after which the days begin to shorten, and the sun sets out on his downward journey:

“To the darksome hollows
Where the frosts of winter lie.”
Such a turning-point of the year, when vegetation might be thought to share the incipient though still almost imperceptible decay of summer, might very well be chosen by primitive man as a fit moment for resorting to those magic rites by which he hopes to stay the decline, or at least to ensure the revival, of plant life.
  But while the death of vegetation appears to have been represented in all, and its revival in some, of these spring and midsummer ceremonies, there are features in some of them which can hardly be explained on this hypothesis alone. The solemn funeral, the lamentations, and the mourning attire, which often characterise these rites, are indeed appropriate at the death of the beneficent spirit of vegetation. But what shall we say of the glee with which the effigy is often carried out, of the sticks and stones with which it is assailed, and the taunts and curses which are hurled at it? What shall we say of the dread of the effigy evinced by the haste with which the bearers scamper home as soon as they have thrown it away, and by the belief that some one must soon die in any house into which it has looked? This dread might perhaps be explained by a belief that there is a certain infectiousness in the dead spirit of vegetation which renders its approach dangerous. But this explanation, besides being rather strained, does not cover the rejoicings which often attend the carrying out of Death. We must therefore recognise two distinct and seemingly opposite features in these ceremonies: on the one hand, sorrow for the death, and affection and respect for the dead; on the other hand, fear and hatred of the dead, and rejoicings at his death. How the former of these features is to be explained I have attempted to show: how the latter came to be so closely associated with the former is a question which I shall try to answer in the sequel.   2