Amazon's next foray into physical retail threatens to hit Wal-Mart where it hurts.

The online seller said Tuesday that it's testing a service for Prime members that provides free pickup of fresh grocery items in as quickly as 15 minutes. Subscribers can also schedule pick up within a one- or two-hour window.

Though the test is only underway in two Seattle neighborhoods and just with Amazon employees, it's a direct challenge to Wal-Mart's grocery pickup service. That service has helped power Wal-Mart's recent sales momentum, including growth in its domestic grocery department last fiscal quarter. That's despite deflationary prices. It also contributed to Wal-Mart's U.S. division growing online sales by 29 percent over the holiday quarter.

Wal-Mart last year expanded online grocery to more than 600 locations across 100-plus markets. It will roll it out to roughly 500 more locations this year, a spokeswoman told CNBC.

"This model often makes more sense in suburban areas, as the delivery model is often too expensive to execute given the lower population density," Citi analyst Alvin Concepcion wrote in a recent research note. "It can also be convenient for customers to schedule their grocery pickup window when they're getting off of work or some other routine time."

Concepcion estimates that for retailers who are the first in their market to offer these so-called click-and-collect services, roughly 60 percent of the sales are incremental.

Like Amazon's test, Wal-Mart's version of grocery pickup allows shoppers to place their orders online and have food loaded into their cars as soon as later that day.

But while Citi found that Wal-Mart's prices are often lower, it has more restrictions. When CNBC tried to place an order at the retailer's Lake Mary, Florida, location, at 10:20 a.m. Tuesday, the earliest available one-hour pickup slot for the selected items was Wednesday between 8 a.m. and 9 a.m.

Generally speaking, orders placed by 1 a.m. will be available for pickup starting at 8 a.m., and orders placed by 10 a.m. will be available from 4 p.m., according to the Wal-Mart spokeswoman.

Unlike Amazon's version, which has no order minimum, the vast majority of Wal-Mart's markets require a $30 minimum, the spokeswoman said. However, Wal-Mart's service is free once that order threshold is reached. An annual Prime membership, which is required to use Amazon's service, costs $99.

The stakes are high for Wal-Mart. Groceries accounted for 56 percent of the chain's revenue in fiscal 2016, making it the market share leader. Cowen & Co. analyst John Blackledge estimates Amazon's market share will jump from ninth place in 2017 to third place by 2021.

That doesn't mean growth will be easy. Fresh food is one of the hardest things for retailers to get right, as it requires frequent deliveries and fast sales to avoid spoiling. Grocery is also a notoriously low-margin business, which will see even lower profits as online selling grows, Concepcion said.

Amazon's experiments with fresh food have already been slow going. The retailer in October slashed the $299 upfront membership fee for its AmazonFresh service, in favor of a monthly $14.99 charge. And on Monday, The Wall Street Journal reported that Amazon Go — a convenience store that eliminates the cash register — will delay its public launch as it works out the kinks.

Broadly speaking, groceries have been less susceptible to the shift toward online shopping, as customers by and large still prefer to select their produce by hand. According to Cowen's estimates, less than 5 percent of U.S. grocery sales were completed online last year. That compares with roughly 20 percent for clothing and accessories.

However, as millennial customers get more comfortable with these types of services, Cowen projects online selling could account for 12 percent of grocery revenue by 2022. That would nonetheless earn it a last-place ranking among the eight categories Cowen tracks.

— CNBC's Jeff Daniels contributed to this report