When Puck sees how conceited and ridiculous Bottom is, especially with respect to playing his role as Pyramus, Puck decides to characterize him as a very ridiculous person by giving him a donkey's head. A donkey, which can also be referred to by the slang term "ass," is typically understood to be a stubborn, slow, and ridiculous creature. Hence, when we refer to a person by the slang term "ass," we are referring to that person as stupid, stubborn, and ridiculous. Therefore, the trick Puck plays on the actors is giving Bottom a donkey's head.
Bottom has absolutely no idea he has been transformed into a donkey. When the other mechanicals see Bottom emerge from the hedge with the head of a donkey, they believe they are being haunted and run. Bottom is very puzzled and asks himself why they have all run away. When Snout returns and asks Bottom, "What do I see on thee?," Bottom replies that Snout sees a "figment of his own imagination," as we see in Bottom's lines, "What do you see? You see an ass-head of your own, do you?" (III.i.107-110). Likewise, when Quince returns saying, "Bless thee, Bottom, bless thee! Thou art translated," Bottom says to himself that he sees they are playing a trick on him in order to make him appear to be an idiot and to make him scared, as we see in his lines, "I see their knavery: this is to make an ass of me; to fright me, if they could" (111-113).
Hence, we see that the trick Puck plays on Bottom and the rest of the mechanicals is to characterize Bottom as the proverbial ass. Bottom's response is to be completely oblivious to the transformation, thereby proving himself to be a ridiculous and foolish person, or a proverbial ass.