Advantages to thicker oil:
- Thicker films
- Better ring sealing
- Higher oil pressure (until you hit the pump's bypass limit)
- Can run at higher temps without becoming too thin
- If it shears or becomes diluted by fuel, it'll still be pretty thick
Disadvantages to thicker oil:
- More drag on moving parts: less power & fuel economy
- More prone to aeration; could compromise lubrication and cause oil consumption via excess crankcase pressure
- Less efficient cooling; more hot spots
- Won't flow as easily on a cold start
This is all-else-equal, of course. It's entirely possible for a good xw-50 to be better in every way than a bad xw-40. But I'm assuming you wouldn't make that comparison.
A good way to think about viscosity is that you want it to be "as thin as possible, as thick as necessary."