Yes, the root of “secretary” is “secret,” which explains something about its original usage. Originally , a secretary was someone who knew all the secrets, and who handled confidential affairs for someone else.
While the modern usage of the word is quite different, a secretary still likely handles confidential matters. The word implies an assistant who “knows all the secrets.”
This also has political usage. The Secretary of State was originally known as “the state’s secretary,” meaning the person who knew the secrets of the state. It evolved from King’s Clerk, King’s Secretary, or Principal Secretary.
Additionally, there are many earlier usages in a religious sense: secretaries were entrusted with the secrets of God.