it’s more intricate than this. There is store shelf specific plans to define how inventory should be stocked at the SKU level on a given shelf. The distance between the price tags determine the actual shelf space facings usually, in addition to end-caps, which are very premium spaces.
Most large grocers outsource all of this management to intermediary firms that “manage” shelf space for chains, selling and updating their retail merchandising based on marketing campaigns and sales data.
You may find good pricing on brands/products on the lowest shelf, as they tend to be smaller firms that compete with the large players that pay premium for shelf-space, which is sustained by higher pricing.