only to remove it later? Protection. 4-Benzyloxyaniline hydrochloride offers a neat example. Its synthesis can begin with 4-nitrophenol. First, the phenolic OH is converted into a benzyl ether: O-H becomes O-CH2-C6H5.
The oxygen is still there. But now it's wearing a temporary chemical shield. Next, the nitro group can be reduced to an amine while the protected oxygen remains intact. Finally, hydrochloric acid converts the amine into its hydrochloride salt.