On both electric and acoustic guitars, the bridge holds the strings in place on the body.
Acoustic guitar bridges transfer the vibration from the strings to the soundboard, which vibrates the air inside of the guitar, thereby amplifying the sound produced by the strings.
On almost all modern electric guitars, the bridge is adjustable for each string so that intonation stays correct up and down the neck.