Social media was supposed to liberate us, but for many people it has proved addictive, punishing and toxic. What keeps us hooked?