Often first ones when you come in are the fruits and vegetables. I think those have a couple of meanings. First those most often look nice and give a fresh look to the store. Then those actually takes most of the time in store, so having those first make store look popular, since there is always people there. Third, most of the people will always get something from theat section, so it is convenient to have it first, to minimise the trouble from everyone.
Shelves in the store are designed so that in the level of the eye and hand there are the most popular and most used items. In the top and bottom shelves are niche products, which users of those will find even from non optimal places.
Many stores also use the trick on placing products, which have a best before date coming sooner, on the right side of line of products. There are more right-handed people, so those products will get sold before the date from the right side.
Then thinking about cash desk. There are products which are often bought impulsively, like candies and soft drinks. Also close to cash desks there are products which are easy to steal, so cash personnel can try to take an eye on those ones.
In addition, there’s lot of stuff ongoing in the background making sure there are things to sell and those are fresh. Logistics and everything is meant to be silent and unnoticed, still having one of the most important parts of user experience. If there’s nothing to sell in grocery store, user experience is always terrible.
If you compare this to any software, it’s not that different. You want your customers to think this is fresh and easy to use. You want to look popular. You want your content to be there. You want people to exploit some new stuff also on the way. UX in grocery store and SW are not that different. And I actually think no user experience is that different from another.