It creates a constant angular velocity ratio at all points where the gears mesh (the law of gears).
In layman's terms, the tip of the tooth gets thinner so that the angular velocity there is reduced at that larger radius. Otherwise the gears advance/retreat as they rotate, which creates vibration.
I think there might be a whole host of curves that work for this, the other main one being a cycloid, which I'm not really familiar with:
I first learned about involute curves from a cousin that works as a machinist. Mr. Wizard also blew my young mind with noncircular wheels:
Edit: stumbled onto this technique to make involute gears in CAD:
If someone has a simpler method, I'd love to see it.
t = np.linspace(0, 1); (1 - 1j*t) * np.exp(t * 1j)
To me this sounds simpler.
numberTeeth int, // number of gear teeth
gearModule float64, // pitch circle diameter / number of gear teeth
pressureAngle float64, // gear pressure angle (radians)
backlash float64, // backlash expressed as per-tooth distance at pitch circumference
clearance float64, // additional root clearance
ringWidth float64, // width of ring wall (from root circle)
facets int, // number of facets for involute flank