Varied sizes and shapes of acoustic cavities in guitar bodies lead to different tonal characteristics. These include bass and treble, etcetera. Acoustic guitars are shaped to produce specific tones when played. Electric guitars can be any shape and design because they don't depend on the acoustic chamber to create sound. The acoustic guitar is pear-shaped for the player's comfort.
The size of the guitar is determined by the range of notes you want to play, how loud you want the sound to be, and how far you can stretch. The idea behind all the curves is to break up one frequency and attempt to enhance others. Guitars have different shapes to maximize acoustic resonance and offer the user a comfortable instrument.