All of the advice given so far on this very hard-to-quantify topic is good - I especially like
@Aoi Ninami's challenge-reward explanation and
@Tai_MT's point on environmental storytelling.
I feel that "high moments" are an important key to making sure your game transcends mediocrity and becomes great.
- That moment you feel insanely overpowered, even though the designer planned for it and designed the game to be balanced around it
- That moment you create something really, really cool through item creation, and you feel like your ingenuity, skill, or luck helped you create it
- That moment your own decision, and its consequences (especially its positive consequences), made you feel a strong emotion
- That moment you (in a team game) or your favorite character (in a solo game with a party) carry the team through a tough battle
- That moment an enemy, or a new skill you learn, does something undeniably cool that you didn't even realize was possible within the game engine
- That moment a character says exactly what you're thinking, but says it better than you ever could
- That moment when it becomes perfectly clear how your skill in one activity/mechanic is giving you advantages in the others
- That moment something you've been planning for ten hours finally comes to fruition, and the payoff is even better than you expected
- That moment you win a completely fair and challenging contest for the first time, because you played out of your mind
- That moment an NPC that you care about recognizes how awesome or how kind you are
- That moment you're tested to your absolute limits (without the test being too frustrating), and you find a way to overcome it
- That moment you're absolutely convinced you're living in the game world
There are dozens more types of magical moment you can provide your player. But if your game structure and your attention to detail come together to create these high moments frequently, your game will be beloved. If you almost never create these moments, your game will bore people, even if it's competently put together.
Another important concept to learn and master as a designer is
Flow State. You always want the player to feel challenged, but not overwhelmed. If you keep asking the player to do the same thing, they will become bored. But if you overload them with too much at once, or if you throw a challenge at them that they are not skilled enough to overcome (and can't build up enough skill to overcome), they will become frustrated.
(The X-Axis is the player's skill level at a given point in the game. The Y-Axis is the level of challenge presented to the player at a given point in the game. Note that some models use an entire Flow "Channel" from bottom-left to top-right, but I feel that this model more accurately captures how challenge and skill must be at least moderate before Flow can really be achieved.)
Level Design is a big factor in inducing Flow State, especially in action or platformer games. (It's good to use in RPGs too, but System Design is even more important there.) For a masterclass on Level Design, read
Reverse Design: Super Mario World.
Finally, there's something intangible - a sense of tactile feel - that can draw the player into the game more, even beyond its design and its "heart". I really like this Game Maker's Toolkit video where Mark calls it "Juice" and gives great examples of games with and without Juice.
▶ YouTube video
There's a lot more to it, but if you get High Moments, Flow State, and Juice right in your game (and those all feed into each other to a certain extent), you'll already have something very, very good on your hands.