I posted this elsewhere for the same picture:
I should add that the tall pipe above the tee is a vent and must extend above the tanks water line. Its height is to prevent draining onto your floor. The function of the vent pipe is to break the syphon so that the water traveling to the sump or wet/dry does not cause air to be sucked into the overflow.
The valve on this is not required but I added it to control the gurgling. They can get loud and annoying. Since the length of pipe going to the sump is longer than the length in the overflow, the pipe going to the sump will generate more suction than the overflow will. The difference results in air being sucked into the vent and down to the sump. This is very audiable and will drive many people nuts. Some people have capped the vent or plugged it with a sponge. This is not wise because this circumvents the purpose of having the vent in the first place. The proper solution is adding a ball valve to bring both syphons to equilibrium. You will know the system is fine tuned by slowly closing the valve just to the point that the gurgling stops. At this point the flow of the overflow is not restricted, only the flow going to the sump is. In other words, the flow going to the sump equals the maximum flow that the overflow can provide.
Also, notice the red is level on both the in-tank portion and the external portion at the bottom of the tee. This is because 1. water seeks its own level and 2. the water drains to the lowest point which is the bottom of the tee.