Nick should make up whatever theory he wishes for this. Many people have a funny impression about science: they think there is a "right" answer to everything. Well there isn't. Nobody knows what the right answer is, ever. We have theories, and we do experiments to see if they fit the theory. When we do the experiments over and over and over and every time they fit the theory, then we start to figure the theory might be right. This is how science works. Right now there are scientists doing experiments just like Nick's and they are getting results just like Nick did. They may have an idea what is going on, but they might not. Usually scientists make a hypothesis BEFORE they do the experiment, and then they TEST the hypothesis by doing the experiment. If Nick's science teacher was on the ball, he/she would have ensured that Nick had a hypothesis before he did his experiment. The hypothesis might have been: Frozen vegetables produce more gas when they rot than fresh vegetables. If he shows this, then that sort of explains it. His experiment proved his hypothesis was right. But if he has done the experiment with no hypothesis, it's kind of too late to make one up. The rules are: you are not allowed to think up the hypothesis after the experiment just to fit the observations. This would be cheating.
I don't know the answer, but I can make stuff up. I can speculate what happened. This would not be the right answer, but it would be a guess. The gas was probably produced by some sort of fermentation process. Either bacteria, yeast, or fungus that was either on the vegetables, or in the jars could have caused this. Sugar is usually the main thing that fuels the fermentation process, but it could have been something else. Usually the gas produced is CO2, carbon dioxide, but other gasses such as hydrogen and hydrogen sulfide could be products of fermentation.
If you want a reason why the different vegetables produced different amounts of gas, I don't know. I could speculate. That means I'm guessing and I don't actually know. My guess is this (and don't forget this is a totally wild guess and is probably wrong): frozen vegetables have less preservatives in them than either fresh or canned vegetables. Remember this is a guess, a speculation, a dream, a fantasy. I have no idea if this is right. To check this, Nick could do another experiment. He could have samples of each kind of vegetable tested for preservatives. This would be too expensive for an 11-year-old, but this would be science in action. We don't know why something happens, so we come up with a hypothesis that we can test by experiment. The hypothesis, this time, is (let's just take one at a time): Frozen vegetables contain less preservatives than fresh vegetables. To test this, you would send samples of each to a testing lab in your area and have them test for common food preservatives such as fungicides, etc.
As I said, I don't know the answer to Nick's questions, but could it just be that when a company sells *frozen* food, they thereby arrest spoilage because it's frozen, hence they don't have to put preservatives on it, yet when a company markets something that is fresh (such as peaches or spinach) and they know it's going to be in boxes, in trucks, in warehouses, on produce store shelves, in people's cars, fridges, and counter tops etc. possibly for weeks, or even months, they need to put chemical preservatives on it? Note: I don't know if this is right. This is something I made up out of thin air.
By the way, if I were you, I would not tell Nick my crazy idea (my speculation). I think he should figure out his own crazy imaginative idea. That way it would be his work, not mine. And, who knows, he might have a more *right* answer than me. Since we are both just making things up.
If you decide to let Nick use my ideas in his report, he MUST make it clear that this is pure speculation (and it would be nice if he gave the source of the speculation), and he must say he has NO EXPERIMENTAL EVIDENCE whatsoever to make this claim. It is purely imaginary. He could however propose further experiments to test these ideas. That is how science moves forward. Nothing counts unless you can prove it with an experiment. We cannot prove my speculation, so it is not the *right* answer.
Other speculations could be: the bottles were not washed the same, and there was less bacteria in the frozen vegetable ones than in the other ones. Or when you freeze vegetables, the cold does something to the gas-producing elves (or molecules) in the vegetable so they are more sleepy (or bent out of shape) and they don't produce as much gas later. The rubber in the balloons was different. The way the balloons were sealed to the jars was not the same. The sugars in the canned and fresh vegetables were greater to begin with than the frozen, so there was more sugar to be converted into gas. I could go on and on with speculation. That is the thing about speculation: you can make up anything. And that's why you should not tell Nick any of this. He should make up his own imaginary reasons. It's this imagination that drives science. But it's also why you need experimental science. Because after you test an imaginary hypothesis with an experiment, it's not imaginary anymore. It's real. If you did not have the experiments, then we could make up anything we wanted to explain the world around us--and that's what they used to do before the scientific method came along.
By the way, even if the experiments work and work and work and fit the theory all the time, they can still be wrong. We always hope that new scientists like Nick will come along with better imaginations, and better experiments, to prove the old theories wrong and move us further towards a richer understanding of the natural world around us. That's how it all works.