I have a Mac at home and a Mac at work. All my Anki files are in my OneDrive folder. If I add a card on one computer, OneDrive will update the Anki file. Will the card automatically go into the deck when I open Anki next time on the other computer?
I think so, though you should not run syncing while Anki is open, as that can corrupt your collection.
You can alternatively sync with AnkiWeb: Syncing with AnkiWeb - Anki Manual
OneDrive could lead to corruption: Managing Files - Anki Manual