Gambling is also playing a game, usually specific kind of game, based on luck, not skill - designed only for gambling and you ALWAYS play for money.
Of course we know that there are professional gamers playing games for money - but it NOT gambling. More like sport competition.
So you got it right already and they are really different from each other. Out of the curious mind of human beings, we tend to use games and apply it with gambling. People who play games and running for the prize or reward is not gambling, but people who play games and putting some side bet then that is good to consider as gambling.