This type of water gun is basically a large syringe. There are two main parts: the outer piece which is the barrel, and the inner piece which is the plunger, or piston.
On one end of the piston there is generally some type of seal, that acts as a round, watertight squeegie. This seal allows the piston to draw water into the barrel as you withdraw the piston from the barrel, and to force water out as you push it in.
The hardest part with this style of homemade water gun is the seal. If it's either too tight or too loose, the gun won't work. There are a lot of complicated ways to make an effective seal, but I believe I found a simpler way to get the same results, quickly and easily. I'll explain as we go.