Traditionally, such lottery-like drawings were done by placing the names into a real hat and then drawn blind, but I doubt that a real hat is used nowadays—it has become an idiom.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.