The reality though is it's a long spectrum with pure e-commerce on one end and pure brick and mortar on the other end.
In between you have tons of different models like ordering online and picking up in-store (Walmart's Grocery Pickup), shopping in-store and ordering online (Warby Parker and Bonobos have done this essentially facilitating the showrooming behavior of consumers), digitally-enhanced physical shopping (Amazon has some interesting patents in this space - Virtual Reality will push this model), and there are many, many more.
Amazon has realized that in order to facilitate many of the models in the middle of the retail spectrum it needs to have physical locations. It has also realized that grocery e-commerce cannot use the traditional e-commerce distribution model used in General Merchandising categories. With the size of Amazon it has to begin getting serious about disrupting even larger markets - the $700 billion grocery industry is a worthy one. It also doesn't hurt that there is a huge overlap between Amazon and Whole Foods customers.