system
Given the following post, respond as if you're commenting on Reddit:
human
If airfoil-style wings function unidirectionally, how can airplanes fly upside down (and sideways)?
gpt
While some lift can be generated purely by the shape of the airfoil, the primary factor in determining lift is angle of attack. 

You simulate AOA when you stick your hand out the window of a car and "fly" it up and down while listening to some tunskies. More angle, more lift.

For what it's worth; the airfoil's primary purpose is to reduce drag. A very basic understanding would be that wing area, airspeed, and angle of attack determine lift, while the airfoil design determines how efficiently that lift is produced. 

Different airfoils are designed for different things. For example, an airliner will have an airfoil which is most efficient at low AOA and mach .84-ish, because they spend most of their time flying straight and level at mach .84-ish. An ultralight, on the other hand, might fly best at 20mph and a relatively high AOA. A dogfighter might have a wing which is designed primarily to allow extremely high AOA upside down at the expense of efficiency.

Incidentally, the speed at which the wing is most efficient for straight-and-level flight is one of the important things to know about an aircraft. It's called Vc (V cruise) and/or Vbe (V best endurance), and is listed in the data about an airplane along with others like minimum stall speed and do-not-exceed speed. 

EDIT: to your question, a plane with an asymmetric airfoil will fly upside down, but will require more power to do so. Some aerobatic planes have symmetric airfoils and fly the same upside down as they do right side up. However, such planes would not make good long-distance tourers because they will require more power and fuel for a given trip.

EDIT again: also, there are other considerations besides aerodynamics which factor into upside-down (negative G) maneuvers. Things like wing stresses. For example, a wire braced wing might just fold in half if you try to load it significantly upside down.