Around 15 to 20 years, houses start to need expensive maintenance- new appliances, perhaps siding or roofing if you've had a rough run or it was poorly installed, etc.
If you are unable to sell the house and don't have a nice savings cushion, you need to look at a HELOC to pay for it.
Since sellers often pay real estate agent fees and some others, you need a pretty decent sale price above what you owe on the mortgage just to break even... And then money for moving costs and a down payment on wherever you go next.
Edit: it is also not uncommon to take out a HELOC to pay for sprucing up a house- flooring, new kitchen, etc- if you are struggling to attract any buyers at all. I've known people in smaller towns go into debt just to sell their house because they had to move for a job. They even tried renting it out for awhile since noone was buying, and the renters ended up trashing the place, so that made it even harder.
Why would you want a HELOC just because you can't sell your house for a profit?