Why Are There Ballets in the Middle of French Opera?

Louis XIV dressed as Apollo the sun god for Lully's "Ballet de la Nuit."