For the past three years, Amazon.com (AMZN -0.68%) has been quietly operating inside of Procter & Gamble (PG -0.44%) warehouses according to The Wall Street Journal. The company is also inside or in talks with several other companies, including Seventh Generation, Kimberly-Clark, and Georgia Pacific. Wal-Mart (WMT 0.70%) has long prided itself on its efficient logistics, but it doesn't get any more efficient than shipping straight from the suppliers warehouse to the customer.

Encroaching on staples
Wal-Mart and other brick-and-mortar vendors have dodged online retail in several categories, chief among them is household staples. Just 2% of products in the category are purchased online due to bulky packaging and the relatively low price of most items in stores.

But in the last few years, Amazon has been on a mission to capture a larger portion of the market. It started in the late 2000s when the company aggressively went after diapers.com and its owner Quidsi, finally convincing the owners to sell in 2011. Meanwhile, the company has slowly expanded its Subscribe & Save program it started in 2007 to include more and more household goods. Now, we find out it's partnering with some of the biggest consumer staples companies to cut down on costs and shipping times.

The partnership with P&G is part of a program Amazon calls Vendor Flex. The company hopes to extend the program to multiple suppliers that can mutually benefit from a partnership with Amazon. For Amazon, the cost savings of shipping directly from the supplier allows it to better compete with Wal-Mart and warehouse clubs on price. For a supplier like P&G, it saves the cost of transporting items to Amazon distribution centers and gives it a better presence online.

Wal-Mart's partnership
Wal-Mart is none too happy about the relationship between P&G and Amazon.

Wal-Mart has long enjoyed a strong partnership with Procter & Gamble in which the two businesses share information to improve the efficiency of their supply chains. The partnership was so successful, Wal-Mart extended the system to other suppliers to see what needs to be replenished.

But Amazon has upped the ante, shipping directly from the suppliers warehouse. This is a level of efficiency Wal-Mart can't compete with. By the very nature of its business items need to be transported to Wal-Mart warehouses or stores before consumers can buy them. Sure, Wal-Mart has an e-commerce division, but it's terribly small compared to its in-store sales -- less than 2% of total sales last year.

Could Wal-Mart threaten to drop P&G?
Wal-Mart accounts for more sales of P&G products than any other company. In 2010, Wal-Mart accounted for 16% of Procter & Gamble's total sales. Inversely, P&G products accounted for just 3% of Wal-Mart's sales that year -- not insignificant, but there's a huge disparity in those numbers. Wal-Mart clearly has buying power in this relationship.

What strengthens Wal-Mart's position is the threat of substitutes. While strong brands certainly help sell products, there are plenty of other strong brands in categories P&G competes in, and Wal-Mart has its own store brand products. Not many people are going to stop shopping at Wal-Mart because it doesn't have their usual brand of toothpaste. They'll just buy a different brand.

But here's the rub. Wal-Mart is highly aggressive when it comes to competing with Amazon. It, too, put a bid in for Quidsi in 2011 in an attempt to prevent Amazon from buying it, and failed. The idea that it would let Amazon sell P&G products, while it doesn't, simply wouldn't make sense.

So, it's not a matter of who has the strength in the relationship between P&G and Wal-Mart. It's who has the strength in the relationship between Wal-Mart and Amazon that matters. In my opinion, it looks like Amazon has the upper hand.

Big business
Although only 2% of household staples were sold online last year, that's still a whopping $16 billion in sales -- 25% of Amazon's sales. Analysts at Nielsen Holdings NV expect the number of online sales to double to $32 billion by 2015. Amazon is capable of grabbing a large chunk of this quickly growing market by competing on price and convenience with the likes of Wal-Mart. That should add significant revenue to Amazon's top line in the years to come.