It's not really a like for like comparison. The S8 has been out for a while and has had its price cut down as a result. You always get better value for money if you stay slightly behind the curve and don't buy the fanciest, newest thing going.
The iPhone X price is still ridiculous, don't get me wrong, but Samsung phones are pretty damned expensive on launch, too.