This explains it but I am not the author of this information.
Swim Bladder Disorder
The Swim bladder is a gas-filled sac located inside the fish’s body cavity just above most of the other internal organs. This sac is what gives the fish buoyancy and controls equilibrium. The amount of gas in this sac changes as the fish rises and sinks in the water, enabling it to swim, hover and move in the water. Without the use of the Swim-bladder organ a fish is unable to control it's own movements.
Symptoms:
Fish with a swim bladder disorder appear to have an abnormal swimming pattern, usually with their tail end up. They also appear to have difficulty maintaining equilibrium. They may even float upside down or appear to be stuck at the surface of the water, being unable to swim down, or they may lie on the bottom, unable to rise. Fish with a swim bladder disorder will continue to try and feed, showing a normal appetite.
Cause:
The most common cause of swim bladder disorders is improper diet. An improper diet can lead to intestinal gas or intestinal blockages. Intestinal blockages can irritate the bowel, giving bacteria or other parasites an entry point where they can then cause damage to the swim bladder. Swim bladder disorders are most common in the larger, deep-bodied varieties of Goldfish. Fish also fed a lot of dried foods, especially pellets, are most susceptible. This condition is frequently observed in the later stages of Malawi Bloat, which is primarily due to an improper diet as well and intestinal irritation.
Treatment:
Because this disorder is due principally to an improper diet, a change in their feeding needs to be made. Dried foods with lots of protein should be kept to a minimum. Pellets and other dense foods should be soaked prior to feeding or completely eliminated from their diet. Foods with lots of fiber should be introduced, such as zucchini, squash, spinach, romaine lettuce, peas, and grated carrots. If you suspect that the fish is victim to a bacterial infection, treat the fish with a medicated food.