Ironically, a couple of decades ago they were sitting there with literally the keys to the realm in their hands, and they threw them away. Back in the late 80's they introduced the Sun386i workstation, featuring (drumroll..) Intel's 386 processor and a 386 port of SunOS. This was a proper preemptive multitasking OS with 32-bit virtual memory and a decent GUI, far ahead of Windows 2.x at the time. Not only that, it also had a functioning DOS emulator, allowing the machine to run MS-DOS programs. By focusing on x86, and selling SunOS/x86 for $50 or so they could have become the Microsoft of today.
The Sun386i product line was what got Sun onto huge quantities of financial market desktops, and got Sun beyond Engineering/Server markets in a major way.
And they were set to be the first to market with (drumroll) the Sun486i workstation, which worked even better. In fact it out-performed the first SPARC generation... can't have that! They invested in SPARC to get founder Andy Bechtolsheim to come back! (He wanted to design CPU chips, and that wasn't really practical at a company making primo commodity-based systems.)
But, they weren't interested in playing the massive volumes with razor thin margins game of the PC world, thinking that the unix workstation market was insulated from the PC market. After all, PC's were for chumps running 1-2-3 and Wordperfect.
But the Sun386i was a workstation, not a PC. The big apps were CAD tools and financial analysis packages. One reason it was popular at customer sites was however that if you had one, you didn't need TWO honking big pieces of computer hardware at your desk. The same one could handle all that PC stuff (which you needed regularly) as well as the hefty stuff (which you needed constantly).
The real issues with x86 were political ... sometimes masquerading as strategic. It was developed on the East cost, not the west. Keeping Andy; not having to deal with the fact that the engineering culture on the west coast was aggressively blind to a lot of issues. Wanting to see themselves as Sun Gods. Even the desire to avoid investment in DOS/Windows compatibility, despite the customer demand for it.
So they introduced their own hardware, SPARC, and discontinued SunOS/x86.
They gave the Sun386i product line a nice lingering death, though, then more or less excised it from their corporate histories. That all the wood behind one arrow buzz-phrase, widely used inside Sun for a while, was all about getting rid of non-SPARC product lines. And stifling dissent.
Another factor was that the Sun386i products had a different -- and more Apple-influenced -- design approach. Maybe it was realistic to focus on higher margins for a while. But the level of internal censorchip it took to ignore everything the '386i stood for (and Sun itself once stood for) ... was intensely damaging over the long term. A lot of upper level Sun engineers and managers internalized those battles so deeply they just kept blinders on.