Apple is losing to Samsung on smartphone sales. Here's why