Target's (TGT -0.70%) stock has slipped 12% this year as shares of (AMZN 0.19%) and Walmart (WMT -0.05%) have rallied 29% and 11%, respectively, boosted by their strength in grocery. As many consumers remain on lockdown, they've been stocking their pantries with essentials. While Target is ramping up its grocery offerings this year, it's clearly behind Amazon and Walmart in that department.

Target did see an increase in grocery sales recently, but it's being hurt by declines in higher-margin items such as apparel. At this point, it's reasonable to wonder whether the coronavirus outbreak will mark the end of Target's days as the "good student" of retail. For some clues, let's take a closer look at the current situation.

A woman wearing a medical face mask pushes a shopping cart through a store during the coronavirus outbreak.

Image source: Getty Images.

Each of Target's five product areas generates between 17% and 24% of the company's revenue, according to the most recent annual report. Food and beverage make up 20% of revenue, and while Target hasn't specified how much more that may represent in the future, last year, the company announced an effort to ramp up its grocery offerings.

'Good & Gather'

Target launched its new "Good & Gather" brand in September, aiming to offer more than 2,000 food and beverage products by the end of this year. But progress in grocery may have to wait. Last month, Target said it was putting its plan to offer drive-up and order pick-up services for fresh grocery on hold so it could focus on the immediate needs of customers and staff during the crisis.

Grocery is an important part of business for competitors Walmart and Amazon. It makes up 56% of revenue at Walmart's U.S. stores, according to the company's annual report. Amazon doesn't break down its revenue by business, but a recent report by RBC Capital Markets predicts online grocery may represent $70 billion in gross merchandise volume for Amazon by 2023. That figure represents 25% of the $280.5 billion in net sales Amazon recorded last year. As demand surged in recent weeks, both Walmart and Amazon  created new jobs to keep up with the extra business.

Like its peers, Target has also benefited from demand in grocery and essentials, including medication and cleaning products. The company said same-store sales for the month of February increased 3.8%. And as of that report on March 25, March comparable sales were up 20% year over year -- with food and beverage sales up more than 50%.

Though that sounds positive, declines in higher-margin areas are hurting Target. The company said comparable sales in apparel and accessories fell 20% compared to last March. Target warned that if those declines continue, they may affect gross margin dollar performance for the quarter.

A halt to sales of nonessentials

More recently, some states have called on retailers including Target and Walmart to stop selling nonessential items. The idea is to reduce foot traffic in the stores and therefore coronavirus contamination risk. While it's unclear if this effort will take hold, if it does, it clearly isn't good news for Target.

Does all of this mean Target's days as a strong retailer are over? No. Amazon and Walmart may prevail in the near term, buoyed by grocery -- especially online. But once the coronavirus crisis has passed, Target likely will be back on track. The plan to expand its grocery offerings and make fresh grocery available for pickup should strengthen its position in that area. Though a rise in U.S. unemployment means consumers may be less likely to shop for nonessentials, Target's low prices on apparel and other items will give it an advantage over higher-priced options such as department stores.

In the meantime, share weakness offers a good buying opportunity for a company that has grown revenue and earnings over the past two years and has surpassed analysts' earnings per share estimates over the past four quarters.