Merge From Document creates swatches for every color in the current document in the swatch table of your choice. If your document has gradient fills, they will also be added to the swatch table.
Merge from Document
If you access Merge from Document by right-clicking on a swatch table, the documents colors will be added to the swatch table without any prompting.