One of life's great mysteries.
In truth, they come just like any other insect. They spread through animals, clothes, everything. and when they meet with an environment that they are suited to, they breed. As long as you keep a clean house and chance sheets and use cleaning agents, lice isn't a problem in a home and hasn't been in western countries for 2-3 centuries ever since the first mass produced delousing agents were crafted.
You can get lice from everywhere that can host lice. Dirty clothes that became a habitat to lice. Same for couches, beds, chairs, rugs, etc. To put is simple, if your life takes you through a dirty place, there is a chance lice live there. Don't worry though, only a few types of lice can survive on the human body. Most of them just use humans as a piggy back ride to somewhere and can't survive long. In fact, most are more adapted to live on animals like dogs, cats, cattle, pigs, horses etc and only on them.