This is the difference between hedonic and eudaimonic happiness.
Hedonic exists in the lower half of Maslow’s pyramid, where food, shelter, and sex reside. Eudaimonic exists in the top, where a sense of belonging, sens of purpose, and self-actualization reside.
Although the original theory postulated that hedonic needs must be met before eudaimonic become dominant, Frankl’s work debunked this as mythology. There is no hierarchy of human motivation. There is an interdependent complexity.
I doubt Schopenhauer’s credibility in his characterization of the lower classes, to whom “meaning” and “sense of purpose” may have been of paramount importance in ways that he was incapable of empathizing with.
Nevertheless, his observations on pain and boredom help us identify intellectual antecedents to Maslow, and the schism that had emerged between Freud’s “will to pleasure” and Adler’s “will to power”.