On Windows, dropping a folder onto a folder with the same name merges the two. On a Mac, Finder asks whether to Replace the existing folder, and replacing means the old folder and everything in it goes to the Trash, including files the new folder does not contain.
To merge instead:
- Hold ⌥ while dropping the folder.
- The dialog gains a Merge button. Merge keeps the files from both folders and asks about any with the same name.
When the two folders have no files in common, Finder still asks whether to replace, and the ⌥ trick still shows Merge. "Keep Both" keeps the dropped folder next to the original with a number added to its name.
If you replaced by accident, the old folder is in the Trash until you empty it. Drag it back.