I'd say that deep down inside, it's because they want someone to help them. Maybe they're not getting enough help with the friends that they have or the people they're often with. That's why they're just trying to get some input from other people, even if they are random strangers.
Other times it could also be that they are just seeking attention for whatever reason. It could be because they are secretly bragging about themselves by sharing their problems or they like causing drama around them. There are people like that and there really isn't much we can do about them.