Modern usage is primarily from one of the earliest computer games, Colossal Cave Adventure, in which the idea is to explore an underground cave with many rooms, collecting the treasures found there.
The origin of the word "xyzzy" has been the subject of debate.