Midsummer's Eve is the Swedish national holiday that, beside Christmas, is the most popular across the nation. Its roots can probably be found in pre-Christian religion and the celebration of spring, but no conclusive evidence for a pre-Christian holiday at the exact dates of today's Midsummer has been found. This doesn't necessarily rule out such a holiday, but a good bet would be that our contemporary Midsummer celebration is a conglomerate of many different beliefs and traditions, from different times and belief systems. Fertility rites, nationalistic ideas, celebrations of the summer solstice and of John the Baptist are probable examples of traditions that have given rise to today's Midsummer's Eve.
One shouldn't assume that the rites and traditions tied to our modern holiday are in any way pristine, unaltered and original. For example, the Midsummer's Pole (or Maypole) is often viewed as an ancient phallic symbol, and this may very well be the case, but we have no actual sources mentioning such a pole from pre-Christian times, even if the Irminsul of the ancient Saxons, and the Germanic religion's fascination with trees, fertility and phallic symbols, hints at practices that can possibly correlate with Maypole festivities. What we do know is that the most current iteration of the Swedish Maypole is an invention of the 19th century and that the Maypole in somewhat contemporary model reached Sweden during medieval times through its contacts with Germany.
However, one tradition that is truly ancient, is the Swedish Midsummer custom of collecting fresh flowers and putting beneath your pillow in order to dream of your husband or wife to be. This is an example of a kind of folk magic that has been common through the ages and which has been extra potent on the magical Midsummer's Night, when the borders between this world and the magical realm are at their weakest.