Here "joyfulness" and "gladness of heart" mean the same thing. They emphasize that the people should have been very glad to worship Yahweh. (See: [[rc://en/ta/man/translate/figs-doublet]])
This is a metaphor for Yahweh allowing the enemy to treat the Israelites cruelly and make them slaves. (See: [[rc://en/ta/man/translate/figs-metaphor]])