https://www.eatingwell.com/why-alcohol-is-in-vanilla-extract-11845019
https://en.wikipedia.org/wiki/Vanilla_extract
It boils down to a) the alcohol dissolves the organic materials, leaving the vanilla flavoring; 2) regulations require it (e.g. US FDA mandates minimum 35% alcohol in pure vanilla extract, and iii) alcohol is used because it evaporates away during baking.
Alcohol-free extract is referred to as imitation vanilla extract because it uses synthetic vanillin (often derived from wood pulp, but once was made from anal excretions of beavers).
As for the flavor, vanilla extract contains more than just vanilla.