In economic terms, both scarcity and shortage refer to a situation where there isn't enough of something to go around, a situation where demand exceeds supply at the price sellers require. The two terms are not interchangeable, though. As we will see, there is one major difference between a scarcity versus a shortage.
When something is scarce, it means there isn't enough of it to meet the demand, and it is not possible to create more. Whether because of an unavailability of raw materials to manufacture goods, because the technology or skill no longer exists to create something, or because the product itself is naturally limited, something is scarce if it is a finite resource in high demand.
For example, fossil fuels are in scarce supply because they are non-renewable, and not enough exist in the world to meet our society's energy demands over the long term. Art works of long dead painters, sculptors and other artisans are scarce because however many people want them, there can never be any more. Fresh fruit is scarce out of season, because it is perishable and doesn't grow year round. Although scarcity is a naturally occurring phenomenon and not one created for economic reasons, the result of scarcity is escalating prices.
In contrast, a shortage is created by a sudden spike in demand for a product that can nevertheless be grown, manufactured or created at the price suppliers want to sell it. Manufacturers may make fewer of a product than they could sell to create exclusivity and keep prices high, as in the case of high-end vehicles and luxury goods. Alternatively, electronics manufacturers may produce large quantities of a product but stagger their release into marketing channels to avoid flooding the market and having supply exceed demand, leading to a fall in prices. A shortage may even be a simple matter of the logistics of getting the product to market.
While scarcity is a natural occurrence, shortages are man-made and can be controlled to some extent. A shortage can be overcome either by raising prices to reduce demand, or by making or importing more products to meet demand at the current price level.
With some products, it is even possible to create a shortage in order to stockpile product in the event of a genuine scarcity. Think in terms of food crops that can be freeze dried and stored for years, rather than days or months.
Poor weather, pests and diseases could cause the coffee crop to fail, pushing up the price of coffee for a year until the next crop matures to meet demand. By withholding a portion of the crop each year and distributing it in rotation (selling the oldest stock first), it is possible to create a buffer against rocketing prices in a year when crops do fail. In the same way, fresh fruit picked through the short growing season may be frozen and kept in cold storage with sales staggered to extend their seasonal availability in supermarkets.