In most films set during the second world war, Flak rounds just seem to explode into a cloud of black smoke, shaking the aircraft a bit, but nothing actually happens. Were they really that innefective?
From a previous answer of mine:
It wasn't easy to hit an aircraft flying at 200 mph at 20,000 feet. It took an artillery shell around 20 seconds to reach that height, during which time the aircraft would have travelled more than a mile. Trying to manually aim a gun would have been virtually impossible - so they didn't. Mechanical or electro-mechanical analogue computers called directors (in US service) or predictors (in UK service) predicted the position of an aircraft and directed anti-aircraft guns accordingly. They were supplied with inputs such as range and height from other instruments; in this picture of a British 3.7" AA battery you can see a gun in the background and predictor in the foreground with stereoscopic height and range finders behind it. Heavy guns engaged aircraft at high altitude; the German 88mm, US 90mm and British 3.7" guns were effective up to around 25,000 feet and larger guns (e.g. German 128mm, British 5.25") were deployed over the war, albeit in smaller numbers. Shells were fitted with timed fuses that caused them to explode in a cloud of fragments, so a direct hit was not necessary. At low altitude light flak (typically 20mm - 40mm guns) relied more on weight of fire, automatic guns firing extremely rapidly and often grouped together.
Even with sophisticated fire control systems considerable weight of fire was needed - for each aircraft brought down anywhere from 1,000 - 15,000 shells might be fired by heavy flak depending on the quality of equipment and training and conditions of operation. A major difficulty was the need to see the target aircraft to accurately predict its path; easy enough on a fine day, difficult in cloud, almost impossible at night. Against strategic bombing conducted at night anti-aircraft fire was generally ineffective until the widespread use of radar, either to control searchlights allowing for visual acquisition of the target or to directly control the guns.
The value of flak wasn't only in destroying aircraft. Bombing was most accurate at lower altitude, where flak was most effective, so the higher you could force the enemy to fly the less accurate their bombing. Predictors could be defeated by aircraft performing evasive manoeuvres, changing direction in the time it took shells to reach their altitude, but that wasn't always straightforward, especially in large formations. It was especially disruptive when bombers were trying to line up their bombing run, precise bombing needed straight and level flight, flak again reducing bombing accuracy. The damage caused by shell fragments might not always be fatal to an aircraft but could break up formations and force stragglers to lag behind, assisting fighter defences. Anti-aircraft fire also had a psychological effect, even greater than fighters - at least gunners could fire back at fighters. Not for nothing was the expression "flak happy" coined.
Further reading & watching:
FLAK! - a USAAF training film
Ack-Ack - a British Ministry of Information film
Archie, Flak, AAA and SAM, Kenneth P. Werrell - a brief general overview
Flak: German Anti-aircraft Defenses 1914-1945, Edward B. Westermann
Britain's Air Defences 1939-45, Alfred Price
Courage and Air Warfare: The Aircrew Experience in World War II, Mark K. Wells - on the psychological aspect