The Meissner effect is one of the defining features of superconductivity, and its discovery served to establish that the onset of superconductivity is a phase transition.
The exclusion of magnetic flux is brought about by electrical "screening currents" that flow at the surface of the superconducting metal and which generate a magnetic field that exactly cancels the externally applied field inside the superconductor. These screening currents are generated whenever a superconducting metal is brought inside a magnetic field. This may be understood from the fact that a superconductor has zero electrical resistance (so the "eddy currents" induced by motion of the metal inside a magnetic field will not decay). However, the screening currents also appear in a situation where an initially normal conducting metal is placed inside a magnetic field, as soon as the metal is cooled below the transition temperature (such that it becomes superconducting). This expulsion of magnetic field on cooling down the metal cannot be explained any more by merely assuming zero resistance. It shows that the superconducting state does not depend on the history of preparation (only on the present values of temperature, pressure and magnetic field), and therefore is a true thermodynamic state.
Superconducting magnetic levitation is due to the Meissner effect (which repels a permanent magnet) and flux pinning, which stops the magnet from sliding away.