Even if two models-- one a synth and one a digital piano-- cost exactly the same, they usually have different features and specs. For example, their maximum polyphony might be different, and there's usually a big difference between the number of timbres (instrument sounds) they have. A digital piano is typically going to have fewer timbres, generally focusing on acoustic and electric piano, harpsichord, and maybe organ, acoustic guitar, bass guitar, and strings. A synth is typically going to have a smorgasbord of timbres from all sorts of instruments. A good rule of thumb is that the number of timbres is often proportional to their quality. In other words, a digital piano might have only a handful of timbres compared to a synth, but they will generally be of a high quality, and the keyboard itself (the key action and responsiveness) will usually be closer to that of an acoustic piano.