The term was first used in the context of radio technology by Italian physicist Guglielmo Marconi in the late 19th century. He chose the word because the long, thin wires used to transmit and receive radio waves resembled the masts of ships.
So, while the literal meaning refers to a ship's mast, the word "antenna" in the context of radio and electronics has evolved to mean a device that transmits and receives electromagnetic waves.