How can Panama City be in Florida and not in Panama?

There is a Panama City and a Panama City Beach in Florida and a Panama City in Panama.