In the naval sense, "yeoman" was related to the historical meaning of a retainer to a nobleman. It originally meant someone who was entrusted with certain ship's equipment or supplies for a superior, so there was a yeoman of the powder room, yeoman of the storeroom, sailmaker's yeoman etc. The yeoman responsible for a ship's signal flags in the Royal Navy eventually came to be in charge of all visual signalling, and became a very important petty officer, the yeoman of signals. The petty officer who handled a ship's correspondence and clerical work was known as the "writer." The US Navy inherited the yeoman and writer rates, basically unchanged, from the Royal Navy. In the RN the yeomen gradually faded away, but the title of writer is still used for some administrative and HR-type petty officers.
In 1893, U.S. Navy Regulation Circular No. 1 (more famous for creating the rate of chief petty officer) consolidated the engineer's yeoman, equipment yeoman and paymaster's yeoman under the single title of "yeoman," with the specialty mark of crossed keys. The writer wore crossed quill pens.
https://www.uniform-reference.net/insignia/usn/usn_ratings_1886.html
In 1896 the title of "writer" was replaced by "yeoman." This may be an indication that most of the previous yeoman's duties had been clerical and record-keeping, similar to the writer, and there was no need for a distinction between the two. The first, second and third class yeomen now wore the former writer's crossed quill pens, but the chief yeoman still wore the crossed keys, perhaps indicating the higher level of responsibility for property.
The Naval Appropriations Act of 1916 created the new rating of storekeeper in all petty officer grades. The uniform regulations were modified so all yeomen now wore the quills, and all storekeepers the keys. The rating of storekeeper was re-titled logistics specialist in 2009.
The old title of writer lives on in the USN with the "captain's writer," a yeoman who works directly for the CO, and the "flag writer," the equivalent for an admiral and a very select position.