Virtual surround for headphones (Dolby Atmos for Headphones, DTS Headphone:X, Sony 360 Reality Audio) applies HRTF processing to make stereo headphones sound like a full surround system. The algorithms simulate how sound from different directions would be filtered by your head and ears before reaching your eardrums.
For speakers, virtual surround (sound bars with psychoacoustic processing) uses speaker array beamforming and reflection manipulation to create the illusion of speakers where none exist. The effectiveness depends on room acoustics and listener position. For headphones, binaural rendering is remarkably convincing — especially with personalized HRTFs.