The magician performs the card trick from his hospital bed by forcing a particular card to be selected by the volunteer (there are numerous ways to do this). At the same time, the magician has an assistant waiting on the opposite side of the glass with a duplicate card. The magician turns the volunteer's attention away from the glass while the assistant affixes it to the other side, then throws the deck at the spot where the card is affixed. In the flurry of cards hitting the glass, it's very difficult to see that the card wasn't there before the throw.
The end of the episode featured an "In Memoriam" to Barbara Issak, a supervising sound editor on the show who died on July 21, 2007, of ovarian cancer.
"A sense of impending doom" is an actual medical symptom of various issues. Psychological causes can include anxiety, depression, panic disorder, and bipolar disorder; physiological causes can include a pheochromocytoma, heart attack, blood transfusion, and anaphylaxis.
Steve Valentine, who plays Flynn, also played a magician on the detective show Monk. He appeared in S07E15 entitled Mr. Monk and the Magician.