The replies are also helping me. I have another tip to add. You don't need to export the "On My Mac" cards and import them to get them "moved" from "On My Mac" to your iCloud contacts using Contacts on a Mac. It confused me that I couldn't drag all of my contacts from "On My Mac" to my iCloud in the group navigation bar – but I could drag them to some other "groups".
So I tried doing that with a single "On My Mac" contact, and Contacts still wouldn't allow it. Then I realized that the contact in "On My Mac" had been linked to a contact already in iCloud (as well as a contact linked to my company's LDAP address book). I then edited the "On My Mac" contact and clicked the red "minus" icons next to each of the links to that contact in other locations. That left the "On My Mac" contact as an "isolated" contact record. That contact could now be dragged to iCloud and subsequently deleted from "On My Mac".
It's occasions like this that make me glad Apple includes such features – dragging and dropping, linking and merging contact cards, synchronizing reliably between every device, and finding duplicates – without complicating the visible user interface. Unfortunately, that user interface design strategy often leaves us scratching our heads when trying to accomplish certain things. If only the original attempt to drag those "On My Mac" contacts to iCloud had shown a tool tip saying something like "Can't do that because one or more of the selected cards is already linked to cards in the destination".
On the other hand, the very existence of this issue points to a serious design flaw in Contacts that impacts usability: if Contacts is so good at merging and linking cards while maintaining the differences between linked cards (something no other contact management software I've ever used has done, or done well), then why on earth doesn't that take advantage of the "merge or link" and "detect duplicates" functionality they've already implemented to avoid this confusion in the first place?