A lot of store brands are made by the nationally known large companies. It’s not like the grocery store has its own factories. So the national company may profit just the same.
Even so, they probably don’t make as much on the store-brand stuff they manufacture.