How might Bottom be a foil to Theseus?
In literature, a foil is a character who by contrast accentuates the traits of another character in the story. A few famous examples would be how sports-mind Ron makes the bookish Hermione looks even more bookish, or how the gentle and considerate Watson makes Sherlock Holmes look even more cold and rational.
Bottom is an idiot and a clown. He is a comedic character. He frequently misuses words, demands to play every character in his play, makes a fool of himself at every possible chance, and even physically becomes a jackass.
Theseus, on the other hand, is the very model of intelligence and good judgment. He is named after the Greek hero, who through smarts and bravery defeated the Minotaur. The duke speaks well but plainly. He is articulate. He is anything but a fool.
By watching the two characters' opposite traits the audience can more easily see the qualities in the other. In fact, Bottom is only the most extreme example. Nearly every character behaves foolishly in some way while in the forest, which only makes Theseus' reasoned approach stand out more.