Why is discriminating monopoly better than competitive markets for producers? In intermediate microeconomics by Hal Varian, It is said that discriminating monopoly is better than competitive markets for producers. Why so?
You're looking for an answer while it's clear you are very early in your studies and will get to this stuff in due time.

With that said, here is some loose intuition about why a monopoly is better than competition for a single producer:

In a competitive market, every single consumer and every single producer has the same amount of "bargaining clout".  In particular, no single producer can set prices however it wants, because there is always another producer waiting in the wings to offer a better price.  The market-clearing price and quantity can be viewed as an equitable compromise between relatively equal powers (producers and consumers), and is "fair" in that sense.  There are nuances to this that you will learn, but in economic terms producers do not earn "profit" in a competitive market.  They break even.

By contrast, in a monopoly market, the single producer has (nearly) all of the "bargaining clout" because they control the means of production.  Therefore, they have tremendous freedom to set the price or quantity in such a way that they earn a positive "profit" because there is no other supplier who is able to undercut them on price.  This profit for the producer comes at the expense of the benefits consumers would otherwise enjoy in a competitive market (e.g., other things purchased with the price savings).

Again, these are kind of hand-wavy statements, but illustrate the general idea.