Voluntarily means of your own free choice. Nobody made you, and you could have declined.
It is used most where the alternative would have been compulsion, which is why it appears so often in legal and official writing: attending voluntarily, voluntarily surrendering a licence, leaving voluntarily rather than being dismissed. That contrast is the whole point of the word. It nearly always follows the verb. The adjective voluntary carries the same meaning and also the separate sense of unpaid work.
1adverbvoluntarilyBy free choice rather than compulsion.
“He came in voluntarily to answer questions.”
Proto-Indo-European
*welh₁-
Middle English
voluntarie
English
voluntary
English, today
voluntarily
Built from
From voluntary + -ly. voluntary comes from Middle English voluntarie. From Middle English voluntarie, from Old French volontaire, from Latin voluntārius (“willing, of free will”), from voluntās (“will, choice, desire”), from volēns, present participle of volo (“to will”). Displaced native selfwille.
Etymology from Wiktionary, CC BY-SA