How does the mixture of an engine affect the engine's operation?
Simple Answer: Running the engine lean or rich at different altitudes.

Longer Answer: There are a couple of reasons you want to adjust the mixture of a aircraft engine.  


Since air density changes with altitude, it's a good idea to be able to change the fuel/air mixture at different altitudes.  If you did not adjust the mixture at high altitudes you may not get full power because the air is thinner and now there is same amount of fuel being mixed with less air.  All the unburnt fuel can cause issues like loss of power and/or fouling of plugs.
Being able to lean the mixture at higher altitude lets you save fuel, so you can go further on a full tank.  (hence saving money)
Running a engine rich can help cool engine.  Fuel acts like a coolant in this manner.  Typically on climbing you want to run the engine a bit rich because your going slower and less air is able to help cool the engine.
Traditional piston powered aircraft engines are shut off by pulling the mixture to the off position.  This starves the engine and burns off remaining fuel in the cylinders.


This topic can also bring up other discussions.  Like EGT, CHT, running an engine rich of peak or lean of peak, monitoring fuel flow rate with a flow meter, and fuel injectors on fuel injected systems.

Hope this helps.