Keywords describe a query. Intent describes a goal.
A keyword is what someone typed. Intent is why they typed it. Content built around the keyword alone often misses the goal entirely, and Google has spent years getting better at telling the difference. That means the page that wins isn't always the page with the keyword used the most times. It's the page that answers the actual question behind the words.
Grocery stores make this easy to see because everyone has stood in one. Someone asking "how long does milk last" is not the same shopper as someone typing "order groceries online." Same category, same store, entirely different job to be done.