Firmly means in a way that will not be shifted. Held tight, or said without any room for argument.
It works physically, so a screw is firmly fixed and a lid firmly closed. It works on manner too, and speaking firmly means politely refusing to budge, which is the tone parents and negotiators both aim for. It also marks conviction, so believing something firmly leaves no doubt. The adjective firm covers all three and also means a business, which is a completely separate word.
Middle English
fermely
English, today
firmly
From Middle English fermely; equivalent to firm + -ly.
Etymology from Wiktionary, CC BY-SA