In יונה 1:2–5, the boat Yona is on is referred to generally as an אניה. But in verse 5, Yona goes down to a side room of the ספינה. The commentaries seem to treat the words as synonymous: they don't comment on the difference, and use either words where the verse used the other. What, if anything, is the difference here between אניה and ספינה, and why does each appear where it does?
Malbim explains that ספינה (related to ספון, "concealed") is the lowest room of a ship (whereas אניה is the entire ship). Verse 5 is stressing that Yona descended to the lowest room so that he drown there. Were he higher in the ship, he reasoned, he may be thrown overboard and tossed on the waves until he reached land and survive.
They are synonyms. The latter is used per the GR"A (R' Elijah ben Shlomo Zalman Kremer, also known as the Vilna Gaon) to be a hint (remez) to the ego (the אני) - according to his exegesis, the entire story is an allegory for the journey of the soul in this world, and the אניה represents the body.