They do not always trade at a discount. It’s also possible that they trade a premium. Remember that a closed end fund does not create shares like an open ended fund.
The reasons that a closed end fund can trade at either a premium or at a discount is the same as with all other stocks. If investors believe that the fund will do well in the future, then the NAV will be lower than the market value. Similarly, if investors believe that the fund might not do well, then it’s likely that it will trade at a discount.