Soundbars can actually have a wider soundstage then speakers depending on design. They use two audio techniques. One is to aim the speakers outward. The other is a bit of an audio trick as it does alter the frequency response. If you play the same sound through two speakers side by side but delay one of the speakers the sound will come from more left or right depending which speaker is delayed. This is how sound bars create a wider image than they appear capable and can sometimes create a wider sounstage then speakers placed further apart. Like I said it is a bit of an audio trick and does change the sound, so the sound needs to be compensated with EQ.
Soundbars typically have other limitations that a pair of bookshelf speakers or towers do not have. Many people prefer having a nice set of speakers for music or TV tinstead of a sound bar. Other limitations are dispersion. When you place drivers side by side horizontally you will get dips in the frequency response and not have as good dispersion because of these dips, even when playing using audio tricks. Sound bar drivers are typically smaller maybe 2-3" and won't play as low without EQ. They also won't play as loud without distortion. A bookshelf with a 5" or larger woofer will play louder with less distortion and have better dynamics. And most towers will play lower and louder yet. Size matters for speakers.
Each has its pros and cons and it depends on the application which is better. In general, I prefer a nice pair of speakers over a sound bar. YMMV.