The zoom feature mainly came into the picture to allow users to examine a product in detail and overcome the challenges involved in actually being able to handle the merchandise before buying it.This is especially common in sites which sell products like clothes or products where users might want to get a closer look at the product before making a purchase. To quote this article
One of the downsides of e-commerce is that no matter how hard you work
on you product pages the customer will never be able to have the real
product in his hand, as you normally can when going to a physical
store. Therefore the customer can never feel the fine texture of the
silk cloth, the sturdiness of the titanium lock, or the precise
assembly quality of the camera. For some product categories (apparel
comes to mind) these tactile experiences is a major part of the
overall shopping experience and a decisive purchasing factor.

To close some of the gap between e-commerce and actually holding the
product in your hand, textural images can be used. Textural images are
extreme closeups that take the customer in so close that you can
clearly see the texture and assembly quality. In practice this is
often provided by either a zoom functionality for a high-resolution
product image, or it is a separate image in the gallery providing a
close-up of a part of the product.
That said, it is strongly recommended that multiple product pictures are always recommended to allow users see the product from different angles and close up shots and there seems to be a increasing trend of shops trying to avoid having to provide the functionality by just providing the zoom feature and hoping users will then discover the content by themselves. To quote this article about the importance of product photography
An over-reliance on hover/zoom images. Whilst these image types have
their uses, they rely on the customer to do all of the work to find
the detail, and they are not appropriate for many of the products they
sell, meaning an inefficient experience for the customer. The nature
of these images is very functional, so using a single hover/zoom image
for a product means you miss out on the opportunity to really sell
product features and design details.
Also add to the fact that there is no defined standard about how the zoom functionality should be implemented and shops or stores implement the basic functionality and expect it to serve the purpose that on clicking or hovering the product image starts to zoom in. That said, this article on smashing magazine recommends that products image zoom features should be clearly visible to users and should not be such that they are accidentally discovered by clicking or hovering over the image. To quote the article
Photo galleries are particularly critical in e-commerce industries
such as apparel and consumer electronics. You might not need to see a
wrench from three different angles when shopping at Home Depot, but
more images are better when looking for clothes, shoes or a high-end
smartphone or tablet. A few commonly used patterns are the swipeable
gallery, “double-tap to zoom”, and thumbnails for selecting
photos.

Payless wisely keeps its “Tap tap to zoom” call-out on the screen for
several seconds, giving the shopper time to understand how to navigate
the page and still notice it. The ability to zoom in to a photo to
view a product’s details is critical for apparel and shoes.
In closing I think its just a case of a useful functionality which was just lumped on the site without really understanding how users could use it and what would be the usability issues users might face by an improper implementation (as Jonw pointed out, they can prove to be a nightmare on mobile devices as the zoom functionality gets activated by even an accidental tap)