I've seen fish food containers from the 1930s, and they clearly weren't a new thing. Nice little metal boxes... I'll bet they came very early in the hobby, since it was a big urban pastime and people couldn't get live food. The hobby started to grow around World War one. It took off after the second world war, then began to decline in the early 2000s. I found a reference to paradise fish in a 1666 journal - Penn, who got a state named after him, had one.
London in 1666 didn't have prepared foods.
I think I remember floating pellets for goldfish in the 1960s, at my fishkeeping grandparents' house. Once I started, for tropicals, it was all flakes, with tetra-min as the gold standard. They had veggie, growth, colour and staple food, so were seen as a source for a varied diet. They seem to be looked down on now, ingredients-wise, but they were good food from what I saw and experienced with my fish.
Pellets really hit around the time Malawi Cichlids caught on in the 1980s. They were the same food rolled up in balls, ideal for mbuna, who rasp their food. I've always found getting small sizes of pellets harder than big ones - the package size is small and overpriced. Flake feeds fish of all sizes.
Pet food is a huge business, and there is a tendency to look at the real nutritional needs of various types of fishes. But many in the industry'd sell you sawdust if it paid and companies could get away with it. Right now, it's very competitive and the marketing claims are spectacular. I look at fibre, protein and fillers, then I look at price.