Shakespeare is telling us that infatuation is not the same thing as love, and it is more like a trick such as the flower potion.
Oberon wanted to get back at Titania by making her fall in love with a beast. Puck put a donkey’s head on Bottom, and it was the first thing the anointed Titania saw when she woke up, so she fell in love with Bottom. When she wakes up, she cannot believe her eyes.
How came these things to pass?
O, how mine eyes do loathe his visage now! (Act 4, Scene 1)
She cannot believe her eyes, when not long before she was deeply infatuated with the ass-headed bottom. Like the flower potion, infatuation makes us see things that are soon forgotten.
Likewise, Demetrius wakes up and realizes that he does not love Hermia. He loves Helena, and professes as much to Egeus and Theseus.
But by some power it is,—my love to Hermia,
Melted as the snow, seems to me now
As the remembrance of an idle gaud
Which in my childhood I did dote upon; (Act 4, Scene 1)
So now Lysander and Hermia are together, and Demetrius and Helena are together, and they all have the Duke’s permission to marry. He likewise is confused, but just laughs it away as the folly of young people.
None of these attractions were real attractions. They were temporary, and wore off when they were reversed. When the lovers awoke, they all realized who they should be with.