The connection between air and musical pieces stems from the Italian Renaissance period. At that time, the term "aria" was used to describe a "melodic line" or "tune" in a musical composition. This is because melodies were considered to be like "air" that was flowing and moving freely.
Over time, the term "aria" became specifically associated with a solo vocal piece in an opera, oratorio, or cantata.
So, while the literal meaning is "air", it's ultimately the figurative connection to a melodic line and its free movement that makes the word "aria" so fitting for a vocal musical piece.