A keyboard could be a synthesizer, but most likely a keyboard is something called a sampler. Synthesizers create sounds from scratch using mathematical formulas whereas samplers utilize pre-recorded sounds. Also (expanded) - a keyboard usually relies on preset sounds whether be it stand alone or as midi which is connected to another or a computer (pc/mac), whereas a synthesizer can create sounds (from scratch) using mathematical formulas, which are then passed to digital chips on the motherboard for current synths, or analogue power oscillators on older synths. The better (usually more expensive) a synth - the more ways of sound creation is available. A synthesizer also gives you more flexibility with sound creation, whereas an average keyboard usually relies on preset pcm samples, that are when mixed together - give you "preset" sounds.