Discuss the principles behind the design and operation of gears in mechanical systems. How do engineers optimize gear geometry, materials, and lubrication to minimize wear, noise, and power losses in gear transmissions?