Sync files within folders from Library A to Library B
Why do you need to sync the same files between two different document libraries? It is generally not considered a best practice to maintain two sites with the same files and synching them is complex. There are a number of issues that could pop up trying to do this. From Microsoft's own
documentation, "You may want multiple libraries when there are
distinct differences among the sets of files that you want to store and manage, or among the groups of people who will work with the files." I believe you are asking to keep them in sync, so they are the same and not distinct.
Additionally, duplicating documents in two libraries increases storage requirements, which can lead to higher costs, especially if you have a large volume of documents. You also must maintain consistent security and permissions across two libraries can be complex. Any changes in permissions need to be replicated accurately, which can be error-prone.
If you can explain why you need to do this, maybe someone can offer alternate suggestions instead of trying to keep two document libraries in sync.