People say "Antalya" for the whole province, which stretches from Kemer to beyond Alanya. In this comparison, Antalya means the city itself and the districts around it: the walled old town of Kaleiçi, the long city beach at Konyaaltı to the west, and the resort strip at Lara to the east. Alanya is a separate town much further along the coast to the east, with its own character and its own nearby airport.
That distinction matters, because the choice is really between staying in or next to a working city and staying in a holiday town built around a historic peninsula. Both have beaches, both have history, and both can work for almost any kind of traveller. The differences are in the details.