Just like grocery stores putting milk and bread way in the back so you have to walk by all those high margin items.
https://en.wikipedia.org/wiki/Planogram
You always want dairy and fruits/vegetables on opposite sides of the store since they’re perishable, hence they get purchased the most often, and you want people to walk past all the other aisles every time.
If it were all about sales, then I could buy widgets for $100 a unit, sell them for $50 a unit, and call it a success.
Obviously positioning matters too (hence all the garbage food at checkout), but I wouldn't by default assume that this is the case, and especially not the only driver, behind dairy placement.