Why is the iPhone XS more expensive then the iPhone 11

The iPhone XS is on retail for 899 or 999. The iPhone 11 is just 699. Why is it cheaper?

I wanted to sell my iPhone XS to buy the iPhone 11 . Should I still do it?

Is the iPhone 11 bad quality is it cheap?