Eukaryotes have many genes, so how does RNA polymerase recognize a gene needed to be transcripted?
Genes typically have promoter regions attached to them that scan for the presence of certain conditions. When a promoter's condition is met, it changes shape, encouraging RNA polymerase to bind and start making an RNA transcript of the DNA piece.
In other cases, genes can have suppressor regions where a certain condition actively blocks the attachment of RNA polymerase.
(updated for improved explanation)
Think of the (protein-coding) genome as a giant library full of books (genes). Each book tells the reader how to build 1 product (protein). In practice, a gene can code for multiple proteins via introns, but we will ignore that for simplicity here. The overall concept remains the same.
Now think of RNA polymerase enzymes as a population of simple-minded workers wandering around the library who instinctively attempt to reach for and open books on shelves that they bump into. If a worker is able to access a book and read it, the book's product will be produced. If a book happens to be excessively difficult to access or open, the worker will give up on it and resume wandering. Some workers may be more persistent than others.
Varying accessibility per book title dictates overall rate of production. The library shelves are specially designed such that books detailing construction of products in demand are "easy" to pick up (bookshelf is open and unobstructed), while products that are clearly out-of-demand are "hard" to pick up and read (book is locked down, tied to a 10-pound weight, and there's a plastic blocking piece over the front). If a book is hard to access, only the most persistent workers will read it and build the product it describes (low or completely blocked transcription). If a book is easy to access, most workers have ready to access it, causing the book's described product to proliferate.