You're playing as a dungeon infested by pests(the enemies) that you want to get rid of. As the dungeon, you play by spawning the enemies(which are the cards). To win, you need to play cards in a way that matches the hero's sequence of actions.
I agree the game could convey this a bit better. Some players do seem to think that you're supposed to kill the player even though that results in a game over screen...