Why does the Meissner effect occur? I am a high school student doing a science project in superconductivity so my physics knowledge is  limitated but I have read a lot about the topic so I understand quite a bit. :)
I understand that the magnetic field lines from a magnet wrap around the superconductor, so the superconductor is neither repelled nor attracted to the magnet. It just stays there, trapped in that position and this is due to the Meissner effect. No magnetic flux can penetrate the superconductor.
My question is: Why does the Meissner effect happen? What is the "driving force" behind the Meissner effect? Why can't a magnetic flux penetrate the superconductor ?
 A: An answer to your question is contained in your own comment:
„but if you pull the magnet from the superconductor it will follow it, like it is attracting it or like if the magnet was wrapped around the superconductor. It this entirely explained by the fact that some magnetic flux goes through the superconductor, pinning it“
This is an idea worth to think about.

*

*Meissner and Ochsenfeld discovered the expulsion of a magnetic field from a superconductor during its transition to the superconducting state when it is cooled below the critical temperature. They concluded this from the levitation of superconductive and ultracold materials in a magnetic field.

*The levitation takes place also if the material is placed below the magnetic source. The superconductor is trapped on some distance (magnetic density) from the external magnetic field.

*The levitation gets destroyed by a stronger magnetic field.

*Last not least superconductors are such materials where electrons exist pairwise (Cooper pairs).

Especially the last point allows a deeper insight to the effect of the magnetic field on the electron pairs inside the superconductor. A strong enough magnetic field will align the electrons in the direction of the magnetic field and the superconductor gets attracted to the magnet. And than, now these electrons are influenced in the levitating state? May we have to think about an alignment of Cooper pairs perpendicular to the external field.

The sketch illustrates the idea. Each electron with its magnetic dipole is sketched as a tiny magnet and two of them are shown as pairs. As long as the external magnetic field is not strong enough to align both electrons of the pair along its own field, the alignment takes place between the pairs and the external field meanders inside the superconductor.
A: The answer to the initial question:
In every superconductor can exist long-lived supercurrents, because there are dissipationless charge carriers (electron pairs). An external magnetic field generates in the superconductor an additional free energy, which is directly related to the square of the magnetic field strength $H^2$. Every crystal tends to minimize its free energy, so the superconductor redistributes its fluctuations of supercurrents so that the magnetic field of the supercurrents compensates the external magnetic flux. Therefore the total magnetic field and its energy inside the crystal vanish. Thus the driving force of the Meissner effect is the energy minimization inside the superconductor.
