How are oils esters?Watch
So the overall structure of a triglyceride is as pictured. I've pointed out the ester bonds.
Not all oils are esters. Triacylglycerols and fatty acids are both considered oils, but fatty acids are just carboxylic acids, not esters. It's the long aliphatic chain that makes something an oil, not the ester group.