How algorithms behind social media works