Data is considered, basically, a sentient supercomputer. The ultimate AI. He was built with an ultimate storage capacity of eight hundred quadrillion bits and a total linear computational speed rated at sixty trillion operations per second.
Chess is not a game of intuition or empathy, it's a game of computational skill/power and positional manipulation. Even today's crude computers can beat the best chess players on the planet.
Data is programmed with "extremely advanced" chess routines yet...he loses a chess game to a relative novice chess player. If Diana was a strong player who actually studied the game, she would be reasonably comparable to a modern day 1700-1800 rated 'B' level player. Data on the other hand with his 'extremely advanced' chess routine programming would likely be equivalent to a modern 2800+ rated Grandmaster. At the beginning of TNG 5x14 - 'Conundrum', Counselor Troi--having shown no particular skill much less highly advanced chess skills in her entire existence-- beats Data in a game of chess.
How can this be?