Why veterinarians prescribe certain diets for pets
Veterinarians must prescribe certain therapeutic diets because, depending on the disease being addressed, these foods may contain levels of nutrients below what is legally allowed to be sold for a healthy pet without that medical condition. If a pet has a health issue that warrants a special diet, it should be closely monitored by a veterinarian, even if that diet contains nutrient levels safe for healthy pets.
Typically it's not the ingredients that make therapeutic diets expensive—it's the science that goes into putting them all together. For example, testing kidney diets involves feeding the diets to pets with kidney disease for many months and monitoring how they do compared to pets fed more typical diets, which means lots of bloodwork and other diagnostics. For diets that prevent bladder stones, the food is fed to animals, their urine is collected and tested, and the diet ingredients are then optimized to reduce risk of stone development.
Therapeutic diets designed for food allergies typically contain only the purest ingredients (such as proteins that have been cut up into tiny pieces to evade the immune system), and many are thoroughly tested to eliminate the risk of cross-contamination. (Unfortunately, cross-contamination is extremely common in the "limited ingredient" diets that you can buy at any pet supply store.)
All this testing can cost tens to hundreds of thousands of dollars per diet—and these tests often need to be repeated every time there are any changes made to the diet.
For pets with gastrointestinal conditions, the amount of fiber can be very important. The most accurate way to measure fiber in pet food is by analyzing its total dietary fiber content, which can be three times higher than the "crude" fiber, the measure used for regular pet-food. However, this nutritional value is rarely, if ever, available for standard pet foods due to the expense of the test, which costs 10 to 20 times more than those used to figure out the amount of crude fiber.
And while many pet owners believe that veterinarians make a lot of money selling prescription diets, this is not true. The mark-up on therapeutic pet food is typically less than that of most regular pet food you buy in stores. Many veterinarians stock therapeutic diets more as a convenience to their clients than as a money-maker, and it is common for pet owners to purchase these diets at online retailers or even at pet retail stores with a prescription (just like many drugs can be purchased from an outside pharmacy).
Veterinarians want your pet to be healthy. If they recommend a therapeutic diet, it is because they think it will help your pet. But if you have concerns, ask your veterinarian what makes the diet different from diets that you can purchase at the pet store.