To be clear, a ketogenic diet is not as effective as modern anti-seizure medications. It can come close in about 1/3 of patients (~90% reduction in seizure frequency) but it's not effective for all patients and shouldn't be viewed as an alternative to medication for everyone.
A secondary problem is that the modern definition of a ketogenic diet has become muddied as it has entered mainstream dieting culture. Many people who claim to be on ketogenic diets aren't actually consuming enough fat, or are consuming too much protein, to technically pass the thresholds required to reach the ketone levels used in these studies.
The most common mistake is consuming too much protein. Contrary to popular belief, even fatty foods like bacon are not strictly ketogenic. In fact, it's difficult to reach classic ketogenic thresholds without augmenting with MCT oil, heavy whipping cream, or very large amounts of nuts. Most "keto" recipes online barely meet Atkins criteria, let alone full ketogenic diet ratios. Once people realize they have to literally drink heavy whipping cream or oils to stay in the levels of ketosis required for therapeutic effect, the medications don't sound so bad.