Soundbars, sound decks and other sound systems that can reproduce virtual surround sound reproduce sound waves as if they hit our ears from a certain direction and angle. Additionally, wall reflections are used, which can create the surround sound.
However, it must be added that there is no sound simulation that can replace real rear speakers 100% yet. So if you want real cinema sound, you should go for a real 5.1 surround sound set with at least 6 individual speakers including a subwoofer.