As can be read in Wikipedia, the Night of San Juan is a festival of pagan origin, not very old that is usually linked to light fires or fires linked to the celebrations in which the arrival of the summer solstice was celebrated in the hemisphere North, whose principal rite is a fire.
The purpose of this ritual was "giving more power to the sun", that from those days, was becoming more "weak" -the days are getting shorter until the winter-solstice.
Symbolically fire also has a "purifying" function in people who watched.
It is celebrated in many parts of Europe, but is particularly strong in Spain, Portugal (Fogueiras de São João), Norway (Jonsok), Denmark (Sankthans), Sweden (Midsummer), Finland (Juhannus), Estonia (Jaanipäev) and the UK (Midsummer).
Source: Totana.com / Foto: Diego Antonio