It's (for now, anyway) a fairly routine process. If you've been a legal, self-sufficient resident of Sweden for 4 years, you get permanent residency after a straightforward application.
There is some debate over adding a Swedish-language requirement, but there isn't currently one. That is one of the two difference with Denmark: if you're a non-EU immigrant to Denmark, you need to live there 5 years under the same conditions rather than 4, plus pass a middle-level Danish competency exam.